我无法将自定义 dll 加载到我的新appDomain
.
AppDomainSetup appSetup = new AppDomainSetup()
{
ApplicationName = "PluginsDomain",
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
PrivateBinPath = @"Plugin",
DisallowBindingRedirects = false,
DisallowCodeDownload = true,
ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
};
AppDomain domain = AppDomain.CreateDomain("MyPlugin", null, appSetup);
byte[] bytes = File.ReadAllBytes(@"C:\Users\testUser\Documents\Visual Studio
2012\Projects\BaseClass\BaseClass\bin\helpClass\HelperClass.dll");
Assembly assm= domain.Load(bytes);
Type type=assm.assm.GetExportedTypes()[0];
Object testObj=(Object)appDomain.CreateInstanceAndUnwrap(assm.FullName, type.FullName);
///Here is the problem When I try to compile it show error.