While trying to load an assembly using this code:
mainContainer.Install(FromAssembly.InDirectory(new AssemblyFilter(@"Dll\Folder").FilterByName(a => a.Name.Equals("My.Dll.ToLoad", StringComparison.InvariantCultureIgnoreCase))));
I get this error:
Managed Debugging Assistant 'LoadFromContext' has detected a problem in 'C:\Dev\MyProgram\Release\MyProgram.exe'. Additional information: The assembly named 'b.Edge.Domain' was loaded from 'file:///C:/Dev/MyProgram/Release/Dll/Folder/Referenced.DLL' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.
Actually the Referenced.DLL is referenced by My.Dll.ToLoad, and i cannot disable any exception from Visual Studio for work reasons.
So, the point is: Am I doing something wrong? Is there a way to resolve this problem?
Thank you in advance for any answer,