473,378 Members | 1,578 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,378 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 1168

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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.