How do I load assembly from a file into app domain? I need to load into a non-current app domain so I could unload the domain (and the loaded assembly in it) and then load another version of the assembly.
Here's what I have so far:
AppDomainSetup appDomainSetup = new AppDomainSetup( );
AppDomainSetup appDomainSetup.ShadowCopyFiles = "true";
AppDomainSetup appDomainSetup.ApplicationBase = @"c:\Documents and Settings\user\Local Settings\Temp";
AppDomain appDomain = AppDomain.CreateDomain( "Test", null, appDomainSetup );
string filePath = @"C:\Documents and Settings\user\Local Settings\Temp\Test.dll";
string typeName = "Test.TestAssembly";
object o = appDomain.CreateInstanceFromAndUnwrap( filePath, typeName );
The latest error I'm getting is "Type is not resolved for member 'Test.TestAssembly, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null'".