Reference Dll from differen't folder

Cags

Contributor
Joined
Feb 19, 2004
Messages
695
Location
Melton Mowbray, England
I have a folder structure for my application as follows...

MainAppFolder (folder)
- Global.dll
- Application.exe
- Plugins (folder)
- Plugin1.dll
- Plugin2.dll

The Global.dll file contains the Interface declarations which are used by both the Plugins and the Application. By default that structure won't function properly as the Plugins require access to the Global.dll. To get around this I have added an item to the Reference Path list of the Plugin dlls, however I'm concerned that this won't function properly when the application is deployed.

Can anyone tell me if this will still work after deployment, or if it won't work, suggest a better way of achieving the same effect. I know I could put the dll in the system folder but I'm trying to avoid that.
 
Cags said:
I have a folder structure for my application as follows...

MainAppFolder (folder)
- Global.dll
- Application.exe
- Plugins (folder)
- Plugin1.dll
- Plugin2.dll

The Global.dll file contains the Interface declarations which are used by both the Plugins and the Application. By default that structure won't function properly as the Plugins require access to the Global.dll. To get around this I have added an item to the Reference Path list of the Plugin dlls, however I'm concerned that this won't function properly when the application is deployed.

Can anyone tell me if this will still work after deployment, or if it won't work, suggest a better way of achieving the same effect. I know I could put the dll in the system folder but I'm trying to avoid that.

You don't need to be concerned - all you need is to run the test to find out what may go wrong after you had your application deployed.

Does main application load plugins into the main application domain or each plugin "lives" in the separate application domain?
 
As the .exe is in the mainappfolder, together with the global.dll, it should always find the global.dll as far as I know.

There is a way to tell the .net framework about additional 'include' paths: other folders to look in for assemblies (this wont work for DllImport dlls). In the app.config you can add a probing element. See http://msdn2.microsoft.com/en-us/library/823z9h8w.aspx and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfprobing.asp for more information
 
Back
Top