By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,414 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,414 IT Pros & Developers. It's quick & easy.

External DLL

P: n/a
Hello. My program has to use third party components located in several
external libraries.
Those components, also as my program, are usually been changed.

The problem is to make my program use newest versions of external dlls, when
they were during my program compilation.

As far as I know, there are only 2 methods of using components storied in
external dlls:
1. Just setting reference to those libraries. But it does not solve the
problem because newest Assembly.FullName is not the same.
2. Creating a library which implements base Interfaces. So external
components just inherits those interfaces. It also doesn't solve the problem
because sometimes I have to change the base library (changes from
Debug/Release build versions, including new Interfaces and so on). Earlier
compiled external dlls does not recognize new base library (see item 1).

I rally don't want to write intermediate class like this one:
public class IntermediateClass1 {
object srcClassObject;
public int Method1(){
return srcClassObject.GetType().InvokeMember("Method1",
BindingFlags.Public | BindingFlags.InvokeMethod, null, srcClassObject, new
object [] {});
}
}

I know, the library version protection was made to solve the "Dll hell"
problem, but didn't is create a new one?
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi, Nickolay.
..Net let you redirect the built application references to assemblies with
versions that are different from the versions that were used when the
application was built.

Inspect this chapter in the ".NET Framework Developer's Guide": Redirecting
Assembly Versions.
It can help you resolve your problem.
This link to MSDN Library July 2003:
ms-help://MS.MSDNQTR.2003JUL.1033/cpguide/html/cpconassemblyversionredirecti
on.htm

--
Thanks,
Dan Ignatov

"Matora Nickolay" <m_********@mail.ru> wrote in message
news:O4**************@TK2MSFTNGP12.phx.gbl...
Hello. My program has to use third party components located in several
external libraries.
Those components, also as my program, are usually been changed.

The problem is to make my program use newest versions of external dlls, when they were during my program compilation.

As far as I know, there are only 2 methods of using components storied in
external dlls:
1. Just setting reference to those libraries. But it does not solve the
problem because newest Assembly.FullName is not the same.
2. Creating a library which implements base Interfaces. So external
components just inherits those interfaces. It also doesn't solve the problem because sometimes I have to change the base library (changes from
Debug/Release build versions, including new Interfaces and so on). Earlier compiled external dlls does not recognize new base library (see item 1).

I rally don't want to write intermediate class like this one:
public class IntermediateClass1 {
object srcClassObject;
public int Method1(){
return srcClassObject.GetType().InvokeMember("Method1",
BindingFlags.Public | BindingFlags.InvokeMethod, null, srcClassObject, new
object [] {});
}
}

I know, the library version protection was made to solve the "Dll hell"
problem, but didn't is create a new one?

Jul 21 '05 #2

P: n/a
Hi.
Thank you for this articles, but I've found more useable way by using
Assembly.LoadWithPartialName() method and AppDomain.AssemblyResolve event.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.