G
Guest
[C#]
I need to execute another assembly from my code. The assembly I need to
execute uses reflection to dynamically load plug-ins. I create a new Domain
and execute the new assembly within this domain. The application throws an
error as it is looking for the plugins in the base folder for my application,
and not its own. Does anybody know how I set the base folder of the
Application I need to execute?? I've tried setting the
DynamicApplicationBase() but that doesn't seem to work (
My code is roughly as follows:
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationName = "AppToLoad";
setup.ApplicationBase = "C:\AppToLoad.exe;
setup.DynamicBase = "C:\AppToLoad.exe";
AppDomain domain = AppDomain.CreateDomain("MyDomain", null, setup);
domain.SetDynamicBase("C:\AppToLoad.exe");
domain.ExecuteAssembly("C:\AppToLoad.exe");
AppDomain.Unload(domain);
Cheers,
I need to execute another assembly from my code. The assembly I need to
execute uses reflection to dynamically load plug-ins. I create a new Domain
and execute the new assembly within this domain. The application throws an
error as it is looking for the plugins in the base folder for my application,
and not its own. Does anybody know how I set the base folder of the
Application I need to execute?? I've tried setting the
DynamicApplicationBase() but that doesn't seem to work (
My code is roughly as follows:
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationName = "AppToLoad";
setup.ApplicationBase = "C:\AppToLoad.exe;
setup.DynamicBase = "C:\AppToLoad.exe";
AppDomain domain = AppDomain.CreateDomain("MyDomain", null, setup);
domain.SetDynamicBase("C:\AppToLoad.exe");
domain.ExecuteAssembly("C:\AppToLoad.exe");
AppDomain.Unload(domain);
Cheers,