none
DLL Isolation in .NET - just a simple question/verification RRS feed

  • Question

  • Hi,
     
    I was hoping to get a simple verification on what I think .NET does with regards to .DLL access.

    We want to run multiple versions of our application on the same Windows Server box. Our application is a C#.NET application and we parse out a lot of the logic into .dll class libraries. We're doing nothing exotic here - just pretty straightforward stuff.

    With regards to deployment of the .dll files with the application files, we do not install any .dll files in the GAC. We simply include them in the application's main run-time folder.

    So essentially version 1.0 of our app has it's own folder with it's own set of .dll(s). Version 1.1 of our app has it's own folder with it's own set of .dll(s).  And so on... Once again, very straightforward. In other words each version of the app has it's own copy of mathstuff.dll for example, in it's root execution folder.

    I just want to make sure that when version 1.0 of the app runs that it in fact IS running the .dll that is in it's own folder. In other words if we run version 1.0, and then start up 1.1, version 1.1 does not pick up version 1.0's .dll that may be in memory.

    I believe this was a big architecture change in .NET (i.e.) the idea that we could XCOPY deploy so-to-speak and that the assemblies would run in their own isolated domain space. Once again, we do not put these .dll(s) in the GAC at all - because we want the separate versions to run independently.

    I would really appreciate it if someone could chime in and verify this for us?! It would help us out a lot!

    Thanks! 
    Thursday, February 5, 2009 4:08 AM

Answers

  • Yes, no problem here.  The CLR assembly loader will never look in another directory for a DLL, not unless you specifically tell it to do so.  Having a similar one loaded in another process makes no difference.  Storing different versions of a DLL in the GAC is a supported scenario btw; don't worry about it.
    Hans Passant.
    • Proposed as answer by Alex80 Tuesday, February 10, 2009 12:20 AM
    • Marked as answer by Zhi-Xin Ye Tuesday, February 10, 2009 10:38 AM
    Thursday, February 5, 2009 4:40 AM
    Moderator

All replies

  • Yes, no problem here.  The CLR assembly loader will never look in another directory for a DLL, not unless you specifically tell it to do so.  Having a similar one loaded in another process makes no difference.  Storing different versions of a DLL in the GAC is a supported scenario btw; don't worry about it.
    Hans Passant.
    • Proposed as answer by Alex80 Tuesday, February 10, 2009 12:20 AM
    • Marked as answer by Zhi-Xin Ye Tuesday, February 10, 2009 10:38 AM
    Thursday, February 5, 2009 4:40 AM
    Moderator
  • ...thanks Hans - much appreciated!
    Tuesday, February 10, 2009 3:37 PM