Solved usage for multiple dlls of same namespace

Posted on 2009-04-23
Last Modified: 2013-11-07

We need a solution for the following concept in,
DLL A and DLL B has same Namespace but different versions
DLL C and DLL D has same Namespace but different versions
wherein the same application has to use DLL A in one form and DLL B in another form, where DLL A calls DLL C internally and DLL B calls DLL D internally, how to achieve this for DLL reference and at run time. Both the forms can be run at the same time so which dll shall be used by the assembly.
    LVL 39

    Expert Comment

    Sounds like a nightmare scenario to me... I don't have an answer for you, but I can point you perhaps in the right direction:

    The easiest way you can do this is to wrap the dlls in a proxy class. The proxy class then should take care of the loading of the DLL. A wrapper, then, which should be version-agnostic, can take care of "being" the interface to either DLL. The calling application (or other DLLs, will have no notion of what version it is.

    But, instead of going that path, it is best to design your product in such a way that you version all your components alike to prevent this disaster scenario.

    -- Abel --
    LVL 53

    Expert Comment

    The namespaces is just done to make sure that you don't get into such a horrible scenario ...

    Why don't you create one dll containing all the functions of both DLL's ?
    You can easily create different classes in the same dll !
    LVL 39

    Accepted Solution

    4 questions asked, 3 questions open: consider cleaning up your abandoned questions. You can read up on this here:

    On topic: it is also possible to do this (if you really really must) with the assemblyBinding and qualifyAssembly directives inside the app.config or web.config. You can use it to give an alias for a fully qualified name (fully qualified means: including version). In addition, you can use bindingRedirect to forward a certain version of an assembly.

    Finally, if it is about functionality that has moved from one DLL to another but you do not want or cannot recompile existing applications, you can use the TypeForwardedToAttribute.

    But, like I said earlier and as Dhaest confirms: if you can, avoid this nightmare.

    -- Abel --
    LVL 39

    Expert Comment

    This question was actually well answered, I don't think deletion is in place. My suggestion would be to accept the following comment as solution, because it explains exactly (after the rant) how you can tackle this issue:

    suggestion to accept http:#24665806 as answer.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now