473,774 Members | 2,128 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
"OfficeTSWCalle rDemo" (in a directory like
"X:\Blablabla\A ppA\bin\Debug") and an callee application named
"GEMOfficeT SW" (in a directory like "X:\Gagaga\AppB \bin\Debug"). The
latter saves settings in its GEMOfficeTSW.ex e.config and user.config in
C:\Documents and Settings\userna me\Local Settings\Applic ation
Data\company\GE MOfficeTSW.vsho st.exe_Url_da54 u2y5pojuhcg4ad2 nf055bfg50kwr\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.LoadFr om(Path.Combine (strAssemblyDir ectory,
"GEMOfficeTSW.e xe"));
Type typeProgram = assGEMOTSW.GetT ype("AVL.GEM.GE MOfficeTSW.Prog ram");

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

Environment.Cur rentDirectory = strAssemblyDire ctory;
AppDomainSetup info = new AppDomainSetup( );
info.Applicatio nBase = strAssemblyDire ctory;
info.Applicatio nName = "GEMOfficeT SW";
info.PrivateBin Path = strAssemblyDire ctory;
info.Configurat ionFile = strAssemblyFile name + ".config";
AppDomain appDomain = AppDomain.Creat eDomain("GemOTS WDomain", null,
info);
Assembly assGEMOTSW2 = appDomain.Load( "GEMOfficeTSW") ;

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

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 1326

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

Similar topics

5
1795
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 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 developer writes, find a method that matches a
2
3140
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 dynamic loading code will go. The assemblies being dynamically loaded do not contain any code. They are resource-only assemblies. I have succeeded in dynamically loading them within the same AppDomain as the main application (a Winforms EXE that...
4
1431
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 developer writes, find a method that matches a particular interface, and call it. I know, in general, I should be looking at the reflection classes. Does anyone have any design advice for me, or good working examples that would serve as a...
1
5022
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 Service dynamically loads up an assembly that implements an Interface I called IDatabase. To load the assembly and create an object, I wrote this function: private IDatabase LoadDatabasePlugin( string assemblyFile, string
6
4503
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, but I've just started playing around with separate AppDomains and I'm finding that I'm not having problems where I expected I would, so maybe someone can help me understand a bit better. I've read that objects instantiated in separate AppDomains...
4
4216
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 our application framework assembly. It has no life of its own - it's designed to provide components that are glued together by another, main application assembly - let us call it APP. Thus, APP uses APPFX, and APP is registered with ASP.NET as a...
5
1778
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 certain dlls on app startup. Thanks Kev
5
3248
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 running program folder. I then want to load the 'MainClass" found in 'myassembly'. I'm having a little trouble loading because the assembly is not in the program folder. Any suggestions. Thanks, -- Rick
2
2050
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 unload the AppDomain to release the lock on the assemly files (so to I can compile the code again if it has been modified). However, I've encountered a problem, whereby the assembly is also loaded in the default AppDomain! I have a few classes...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8939
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6717
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
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 we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.