473,387 Members | 1,517 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,387 software developers and data experts.

Problem with assemblies loaded via reflection

I am loading some dlls for my application using reflection. These dlls are
plugins as suggested in the MSDN article:

http://msdn.microsoft.com/msdnmag/is...10/Plug%2Dins/

(although I came up with this idea myself before reading the article).
These plugins exist in a plugin directory and are loaded by my main
executable. The problem I am having is that some of my plugins share code
via another assembly (dll). If that dll resides in the plugin directory it
can not be loaded and I get an error message something like "the manifest for
XXX does not match the referenced assembly XXX". The simple solution is to
move these dlls into my main application directory, but this doesn't seem to
make sense as they are not part of my main application they only exist to
support the plugins. Is there a better solution? Some way to indicate that
the reference should search the plugins directory as well?

Thanks in advance,
Jon Walker
Nov 22 '05 #1
3 962
Would using the "System.AppDomain.AssemblyResolve" event help?
Not sure it is your solution but may be worth a try.
Nov 22 '05 #2
I have been working on this problem as well. If you want it to search
your plugins folder, you can use the AppendPrivatePath method to cause
that to happen:

AppDomain.CurrentDomain.AppendPrivatePath(path)

After executing the line, the assembly prober will look in that path
for assemblies. The path must be relative to the base path of the
application.

Nov 22 '05 #3
The bad thing is that this method is deprecated in .Net 2.0
In .Net 2.0 you can't change the PrivateBinPath of the default AppDomain so
you
are ...

"Chris Dunaway" wrote:
I have been working on this problem as well. If you want it to search
your plugins folder, you can use the AppendPrivatePath method to cause
that to happen:

AppDomain.CurrentDomain.AppendPrivatePath(path)

After executing the line, the assembly prober will look in that path
for assemblies. The path must be relative to the base path of the
application.

Nov 22 '05 #4

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

Similar topics

12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
6
by: JonS. | last post by:
Hi, I'm trying to create a Windows Forms portal application and need some help. What I currently have is a main application (.exe) containing an MDI form. The idea is that this main application...
7
by: Lance Barger | last post by:
I have been developing several web applications in VB.NET. I have started to notice that when I run one of the applications, all the assemblies for that application get loaded PLUS all the...
1
by: Bob | last post by:
For an assembly I manually load from a file, this code snippet: For Each t As Type In asm.GetTypes 'do something Next generates this error message: ...
8
by: Charles Law | last post by:
I'm sorry to keep harping on about this one, but it is really quite important for me to be able to list _all_ required assemblies in my Help About box. Herfried kindly posted some code before that...
0
by: npthomson | last post by:
Hi all, This could get a bit complicated but I'll try to be as clear as possible. I've written an application that discovers plugins at runtime using reflection from a subdirectory of the...
19
by: Larry Smith | last post by:
Hi there, When I run the following on my app's primary thread: System.Type.GetType("System.Windows.Forms.Form") It works as expected. If I then launch a thread via the "BackgroundWorker"...
1
by: Jordan S. | last post by:
I plan to load an assembly during application startup, and load that assembly via reflection (i.e., it isn't referenced in the application's assembly manifest). The assembly will be loaded into the...
1
by: =?Windows-1252?Q?Tor_B=E5dshaug?= | last post by:
BlankHi, I am having trouble loading assemblies from the database in my ASP.NET app. I have a default.aspx in my app that is served from a database via a custom virtual path provider. This works...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
0
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,...

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.