External DLL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matora Nickolay

    #1

    External DLL

    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.FullNa me 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 IntermediateCla ss1 {
    object srcClassObject;
    public int Method1(){
    return srcClassObject. GetType().Invok eMember("Method 1",
    BindingFlags.Pu blic | BindingFlags.In vokeMethod, 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?


  • Dan Ignatov

    #2
    Re: External DLL

    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.2003 JUL.1033/cpguide/html/cpconassemblyve rsionredirecti
    on.htm

    --
    Thanks,
    Dan Ignatov

    "Matora Nickolay" <m_nickolay@mai l.ru> wrote in message
    news:O4wCm7chDH A.2544@TK2MSFTN GP12.phx.gbl...[color=blue]
    > 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,[/color]
    when[color=blue]
    > 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.FullNa me 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[/color]
    problem[color=blue]
    > because sometimes I have to change the base library (changes from
    > Debug/Release build versions, including new Interfaces and so on).[/color]
    Earlier[color=blue]
    > 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 IntermediateCla ss1 {
    > object srcClassObject;
    > public int Method1(){
    > return srcClassObject. GetType().Invok eMember("Method 1",
    > BindingFlags.Pu blic | BindingFlags.In vokeMethod, 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?
    >
    >[/color]


    Comment

    • Matora Nickolay

      #3
      Re: External DLL

      Hi.
      Thank you for this articles, but I've found more useable way by using
      Assembly.LoadWi thPartialName() method and AppDomain.Assem blyResolve event.

      Comment

      Working...