Executing an Assembly in its own process - BasePath

G

Guest

Hi,

I have an application (AppA) that needs to execute another application
(AppB). AppB dynamically loads plugins from a relative file path (ie
C:\AppB\Plugins). When I execute AppB from AppA then it searches for the
plugins in a relative path based on AppA (ie C:\AppA\Plugins), and
consequently won't load.

Code is similar to this...

AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationName = "AppB";
AppDomain domain = AppDomain.CreateDomain("AppBDomain", null, setup);
domain.ExecuteAssembly("C:\AppB\AppB.exe");

Cheers
 
G

Guest

Why not having your main application entry as APPA.EXE and then having the
rest of your application feature as assemblie (APPB.DLL) ?


First it will be more easy to maintain and portable

I am building a similar plug in applciation. I have a main application which
should autoconfigured menus and functions absed on existing plugins which
loaads dynamically, it works great.

YOur plugin object will be then created by using :

objDomain =
AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(Application.StartupPath &
PLUGINS_FILE_PATH & "\myplugin.dll", "myNamespace.APPB.myClassName)

you can then retriev object property by writnig
return (CType(objDomain, IPlugIn).Icon)

hope it helps
serge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top