テストのためだけに c# 4.0 とコンソール アプリケーションを使用していますが、次のコードでは例外が発生します。
AppDomainSetup appSetup = new AppDomainSetup()
{
ApplicationName = "PluginsDomain",
ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
PrivateBinPath = @"Plugins",
ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
};
AppDomain appDomain = AppDomain.CreateDomain("PluginsDomain", null, appSetup);
AssemblyName assemblyName = AssemblyName.GetAssemblyName(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins", "sample.dll"));
Assembly assembly = appDomain.Load(assemblyName); //This gives an exception of File not found
AppDomain.Unload(appDomain);
作成した AppDomain でLoadを使用すると、File not found 例外が発生し続けます。
ありがとう。