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

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.

\AppRoot\Main.dll
\AppRoot\AGroupOfDLLs\Abc.dll

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
only.

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.

Thanks

Mar 6 '06 #1
0 1571

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

Similar topics

2
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...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
2
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...
6
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each...
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
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
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...

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.