Hi,
I am using AppdomainToolKit and my code goes as follows:
string basePath = "C:\\Uploader\\Bin";
var setupInfo = new AppDomainSetup();
setupInfo.ApplicationName = "SomeName";
setupInfo.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
setupInfo.PrivateBinPath = Path.Combine(basePath, "PluginFolder\\Plugin.dll");
try
{
var context = AppDomainContext.Create(setupInfo);
context.LoadAssembly(LoadMethod.LoadFrom, Path.Combine(basePath,
"PluginFolder\\Plugin.dll"));
return context.Domain;
}
I see that Appdomain is sometimes loading dlls from basePath (C:\Uploader\Bin) and sometimes from PrivateBinPath.
The exact issue is Plugin.dll is using Polly.dll which is signed and PluginFolder(C:\Uploader\Bin\PluginFolder) contains it. And C:\Uploader\Bin (basePath) is holding another Polly.dll which is unsigned. Now when the Plugin.dll is loaded into Appdomain its looking for Polly.dll in basePath (C:\Uploader\Bin) instead of C:\Uploader\Bin\PluginFolder and throws exception.
Am i doing the right thing in my code?
Please help me to understand the concept behind this issue and help me resolve it.
Hi,
I am using AppdomainToolKit and my code goes as follows:
I see that Appdomain is sometimes loading dlls from basePath (C:\Uploader\Bin) and sometimes from PrivateBinPath.
The exact issue is Plugin.dll is using Polly.dll which is signed and PluginFolder(C:\Uploader\Bin\PluginFolder) contains it. And C:\Uploader\Bin (basePath) is holding another Polly.dll which is unsigned. Now when the Plugin.dll is loaded into Appdomain its looking for Polly.dll in basePath (C:\Uploader\Bin) instead of C:\Uploader\Bin\PluginFolder and throws exception.
Am i doing the right thing in my code?
Please help me to understand the concept behind this issue and help me resolve it.