AppDomain.Load
I have some problems with loading assemblies in a new AppDomain. When I invoke myAppDomain.Load(string) I get the following exception:
File or assembly name ...dll, or one of its dependencies, was not found.
I have tried loading an assembly that does not depend on any assemblies other than those referenced by console applications. I have googled a lot, but have not found any magic line of code that fixes this.
This is roughly what I do:
Evidence currentEvidence = AppDomain.CurrentDomain.Evidence; Evidence newEvidence =new Evidence(currentEvidence);; AppDomainSetup domainSetup =new AppDomainSetup(); AppDomain newDomain =null; Assembly assembly =null; domainSetup.ApplicationBase = Path.GetDirectoryName(myAssembly); assembly = newDomain.Load(Path.GetFullPath(myAssembly)); |
What am I doing wrong?
Thanks in advance,
Nille

