473,507 Members | 12,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loading assembly in app domain

Hi NG!

I have troubles with loading an application to its own app domain.

I have two applications: An caller application named
"OfficeTSWCallerDemo" (in a directory like
"X:\Blablabla\AppA\bin\Debug") and an callee application named
"GEMOfficeTSW" (in a directory like "X:\Gagaga\AppB\bin\Debug"). The
latter saves settings in its GEMOfficeTSW.exe.config and user.config in
C:\Documents and Settings\username\Local Settings\Application
Data\company\GEMOfficeTSW.vshost.exe_Url_da54u2y5p ojuhcg4ad2nf055bfg50kwr\0.9.0.0.
The problem is that if the caller applications loads the callee
application, the callee application cannot read and write settings
accordingly (for one date, always the defaut value is returned, for
another one it works). I suspected that this is a problem related to
the application domain. So I thought instead of calling the callee
application with

Assembly assGEMOTSW =
Assembly.LoadFrom(Path.Combine(strAssemblyDirector y,
"GEMOfficeTSW.exe"));
Type typeProgram = assGEMOTSW.GetType("AVL.GEM.GEMOfficeTSW.Program") ;

I do this with the creation of a new application domain, like below:

Environment.CurrentDirectory = strAssemblyDirectory;
AppDomainSetup info = new AppDomainSetup();
info.ApplicationBase = strAssemblyDirectory;
info.ApplicationName = "GEMOfficeTSW";
info.PrivateBinPath = strAssemblyDirectory;
info.ConfigurationFile = strAssemblyFilename + ".config";
AppDomain appDomain = AppDomain.CreateDomain("GemOTSWDomain", null,
info);
Assembly assGEMOTSW2 = appDomain.Load("GEMOfficeTSW");

If I run this code, I get an error in the line with
"AppDomain.CreateDomain":

Could not load file or assembly 'GEMOfficeTSW, Version=0.9.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.

I don't have a clue what I made wrong. :-( I already googled a lot but
I could not find an appropriate solution.

Can anybode help me?

BR,

Michael

Oct 19 '06 #1
0 1309

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

Similar topics

5
1764
by: Nick Malik | last post by:
reposting to a wider audience "Nick Malik" <nickmalik@hotmail.nospam.com> wrote in message news:WYONc.203854$XM6.119642@attbi_s53... > My turn to ask a question > > I am working on a plug-in...
2
3106
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
4
1421
by: Nick Malik | last post by:
My turn to ask a question I am working on a plug-in for Sharepoint that will allow a developer to add workflow rules. One of the rules will inform the adapter that it should load a DLL that the...
1
4993
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web...
6
4488
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
4
4186
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
5
1765
by: Mantorok | last post by:
Hi I have a project that references one of our components, is there a way in ..Net to get a list of references that the application is depending on? The reason for this is so I can load...
5
3227
by: RickN | last post by:
I want to creat a new application domain called 'mydomain' and then load an assembly named 'myassembly.dll' into the domain. The assembly is in the folder "C:\Mydata\assembly", which is not the...
2
2038
by: Jeff | last post by:
Hi I'm trying to achieve a scenario where I have c# files that are compiled dynamically, the assemblies are then loaded in a different AppDomain, I call a simple method from the object, and then...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.