Hi all
I have a problem with loading a assembly ...
I am trying to do the following:
- I have a directory with a dll (assembly) in it (not the currect dir.)
- I am trying to load this assembly, run a method in it, and than close it.
The question would be: How is the right way to do it ????
The following way works, exept that I need to copy the dll into the
current directory and I am unable to unload it ...
System.AppDomain local_AppDomain;
sCONTROLInterface.sCONTROLInterface local_InterfaceObject;
System.Reflection.Assembly local_Assembly;
object local_Object;
local_AppDomain =
System.AppDomain.CreateDomain("DynamicDomain");
local_Assembly =
local_AppDomain.Load(System.Reflection.AssemblyNam e.GetAssemblyName(@"C:\temp\PlugIn\xyz.dll"));
local_Object = local_Assembly.CreateInstance("xyz.cls1");
If I try to add a AppDomainSetup, it does not work at all ...
System.AppDomainSetup local_AppDomainSetup;
System.AppDomain local_AppDomain;
sCONTROLInterface.sCONTROLInterface local_InterfaceObject;
System.Reflection.Assembly local_Assembly;
object local_Object;
local_AppDomainSetup = new AppDomainSetup();
local_AppDomainSetup.ApplicationBase = "file:///" +
@"C:\temp\PlugIn";
local_AppDomain =
System.AppDomain.CreateDomain("DynamicDomain", null, local_AppDomainSetup);
local_Object = local_AppDomain.CreateInstance("xyz",
"xyz.cls1");
PLEASE HELP ... !!!!
Thanks for any comment !
Best regards
Frank Uray