470,596 Members | 1,152 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

Loading dependent assemblies dynamically from different folders

Hi all,

I have a problem in loading Assembly dynamically through the Reflection.

I want to Load an assembly, say, Main.dll. The Main.dll is dependent on a
DLL, say Abc.dll, which is placed in another known directory.


I am using “Assembly.LoadFrom(pathToMaindll)” to load the DLL, but as the
Main.dll needs Abc.dll which located somewhere else, obviously I need to
provide path for Abc.dll.

I appended the path of Abc.dll in current domain by,
“oAppDomain.AppendPrivatePath (pathToAbcDll)”, which, I hope, is the right
thing to do.

Now when I load Main.dll using “Assembly.LoadFrom(pathToMaindll)”, it throws
System.Reflection.ReflectionTypeLoadException, saying "One or more of the
types in the assembly unable to load".

It is necessary for me to keep the DLLs in different folder. I also
brainstormed for other possible route, but it seems I need to go this way

In nutshell, the problem is to load an assembly, which is dependent on some
assemblies placed in another folder.

It would be great for me to have the solution. If anyone can point some link
where advance (working related) topics of .NET are explanation then that
would also be of ample use to me.


Mar 6 '06 #1
0 1450

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.