locked
adding same dll in different version RRS feed

  • Question

  •  Hello,

     

     

    I'm stuck with this structure:

    "NewProject"  (2.0)    <=>    Errors.dll (1.1)    <=>   ClassA (1.1)     <=>     Cmmn.dll (1.1)

                                   <=>    ClassB (2.0)     <=>     Cmmn.dll (2.0)

     

     

    I once wrote an error-logging dll in .NET 1.1: "Errors.dll", which calls a class and this class uses functions from another dll "Cmmn.dll", also version 1.1

    Now i re-use this "Errors.dll" from a new project, which is in .NET 2.0. This new project references a class which also needs to call functions from "Cmmn.dll", but in version 2.0...

     

    Of course, as soon as ClassA needs a call from Cmmn.dll, i get the "FileLoadException".

     

    I tried to rename the Cmmn.dll (version 2 at least), but it didn't work. It's rather difficult for me to make changes in any code, except my "NewProject".

     

    Any idea how i can prevent conflicts?

     

     

    Thanks!

    j.

    Monday, August 6, 2007 11:10 AM

All replies

  • Hi,

     

    It seems like dot net dll files in ( framework 1.0 ) from VS2003 won't work in VS2005 ( framework 2.0 ) or vice-versa according to your post?

     

    Try reloading the DLL projects and cut and copy the code to a new project each time.

     

    Rename each project Errors_V1.dll,  Cmmn_V1.dll for your version 1.0 files.

     

    Errors_V2.dll,  Cmmn_V2.dll for your version 2.0 files.

     

    I think renaming them won't work as they will have internal references ( inside the DLL files ) to the appropriate framework that they were built on.

     

    I have the following FrameWorks installed on my PC.

    They install to separate areas with each version of Visual Studio.>>>>

     

    http://i13.photobucket.com/albums/a272/u-might-want-this/My-Dot-Net-FrameWorks.jpg

     

    To see which you have, click on AddRemove Programs in the Control Panel.

     

     

     

    Regards,

     

    S_DS

     

    Monday, August 6, 2007 10:17 PM
  • Hello, S_DS, and thanks for your answer.

     

     

    I tried renaming the errors.dll, but it doesn't solve the problem.

     

    Also, I already wrote applications in VS2005, which referenced Cmmn.dll (1.1).

     

    Still, i'm convinced that .NET 2.0 must provide a way to reference 2 assemblies with the same name, but different version.

     

     

    Thanks,

    j

    Tuesday, August 7, 2007 6:45 AM
  • This link seemed to address my problem. I tried it, but it didn't work ...

    http://support.microsoft.com/kb/814197

    Wednesday, August 8, 2007 7:55 AM