title: Appdomain not woking with .net 6?
body: <p>So I have been following the tutorial at <a href="https://docs.microsoft.com/en-us/previous-versions/dotnet/framework/code-access-security/how-to-run-partially-trusted-code-in-a-sandbox?redirectedfrom=MSDN" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/previous-versions/dotnet/framework/code-access-security/how-to-run-partially-trusted-code-in-a-sandbox?redirectedfrom=MSDN</a> to run untrusted code in a test environment with Appdomain, but I'm having trouble with AppDomainSetup constructor and the ApplicationBase property.
  This is basically the code included in the tutorial :</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.IO;
  using System.Security;
  using System.Security.Policy;
  using System.Security.Permissions;
  using System.Reflection;
  using System.Runtime.Remoting;
  
  
  
  //The Sandboxer class needs to derive from MarshalByRefObject so that we can create it in another
  // AppDomain and refer to it from the default AppDomain.
  class Sandboxer 
  {
      const string pathToUntrusted = @&quot;..\..\..\UntrustedCode\bin\Debug&quot;;
      const string untrustedAssembly = &quot;UntrustedCode&quot;;
      const string untrustedClass = &quot;UntrustedCode.UntrustedClass&quot;;
      const string entryPoint = &quot;IsFibonacci&quot;;
      private static Object[] parameters = { 45 };
      static void Main()
      {
          
          AppDomainSetup adSetup = new AppDomainSetup; **//Getting an error here that the constructor doesn't take 0 argumnets**
          adSetup.ApplicationBase = Path.GetFullPath(pathToUntrusted);//Similar error here
  
         
          PermissionSet permSet = new PermissionSet(PermissionState.None);
          permSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
  
        
          StrongName fullTrustAssembly = typeof(Sandboxer).Assembly.Evidence.GetHostEvidence&lt;StrongName&gt;();
  
          
          AppDomain newDomain = AppDomain.CreateDomain(&quot;Sandbox&quot;, null, adSetup, permSet, fullTrustAssembly); //another error here,
  
          
          ObjectHandle handle = Activator.CreateInstanceFrom(
              newDomain, typeof(Sandboxer).Assembly.ManifestModule.FullyQualifiedName,
              typeof(Sandboxer).FullName
              );
          
          Sandboxer newDomainInstance = (Sandboxer)handle.Unwrap();
          newDomainInstance.ExecuteUntrustedCode(untrustedAssembly, untrustedClass, entryPoint, parameters);
      }
      public void ExecuteUntrustedCode(string assemblyName, string typeName, string entryPoint, Object[] parameters)
      {
          
         
          MethodInfo target = Assembly.Load(assemblyName).GetType(typeName).GetMethod(entryPoint);
          try
          {
              
              bool retVal = (bool)target.Invoke(null, parameters);
          }
          catch (Exception ex)
          {
              
              new PermissionSet(PermissionState.Unrestricted).Assert();
              Console.WriteLine(&quot;SecurityException caught:\n{0}&quot;, ex.ToString());
              CodeAccessPermission.RevertAssert();
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  <p>Am I missing a library or something here?
  If this tutorial is outdated or something, could someone help me with an up-to-date one ?
  Thanks in advance :) .</p>