473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Executing an Assembly in its own process - BasePath

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

Jul 21 '05 #1
1 1165

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.CreateInstanceFromAndUnwra p(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

"Neds" wrote:
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SLE | last post by:
Hi there, We have a class method which is invoked through Remoting/IIS. Within this class method, we need to get the physical path of the assembly (dll) in which the method is executing. we have...
5
by: erman.olca | last post by:
Hi all, I have a question for you. I used a program two days ago. there was a lan and program was just on one computer. But other computers have its short cut icon on their desktop. And it...
9
by: Michael.Suarez | last post by:
Suppose I have a program that prompts you with a dialogbox to enter a password. If you get the password correct, it allows you into the program, else it kills the program. Suppose that when I...
7
by: Slavan | last post by:
I am trying to execute following code: Type type = Type.GetTypeFromProgID("SomeType.SomeClass", true); object helper = Activator.CreateInstance(type); and get following RemotingException (in...
7
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.