locked
Updating DLL used by wcf service RRS feed

  • Question

  • What I would like to do:

    My wcf service uses a dll to do some actions. My service is started, i did some calls, that dll is used.
    Now I wrote a new version of this dll. I want to copy this new version over my old dll and just keep on working.

    Problem:

    Once the dll is used by the service, it is locked. You cannot copy over it...

     

    This was possible when using a standard asmx web service. Is there a way to make this work with a wcf service? (The wcf service is hosted in a windows service.)

    Help would be appreciated!

    Greetz!

    Thursday, March 15, 2007 10:21 AM

Answers

  • This is a general issue with any dll.   If it's in use, you can't replace it.   One solution is to WebHost your app.   If you drop a new version of a dll, or config file into a virtual directory, the application's app domain is recycled automatically and the app stays up.   The app's assemblies are reloaded.   Any in process calls will fail though.
    Thursday, March 15, 2007 5:39 PM

All replies

  • This is a general issue with any dll.   If it's in use, you can't replace it.   One solution is to WebHost your app.   If you drop a new version of a dll, or config file into a virtual directory, the application's app domain is recycled automatically and the app stays up.   The app's assemblies are reloaded.   Any in process calls will fail though.
    Thursday, March 15, 2007 5:39 PM
  • Well yes, that's the functionality we have now with our webservices. And I do know that a dll in use cannot be replaced. But isn't there a way to unload the dll while the service keeps running? To get a kind of behaviour as when you host it in IIS.

    The reason we ain't gonna host in IIS is that we want to use the netTcpBinding and we are not going to use IIS7.

    Thursday, March 15, 2007 7:01 PM
  • IIS does it by recycling the whole app domain.   Once an assembly is loaded into an app domain, you can't unload it.   If you want to manage your own app domains, here are some references:

    http://msdn2.microsoft.com/en-us/library/9x0wh2z3.aspx

    http://msdn2.microsoft.com/en-us/library/cxk374d9.aspx

    IIS also doesn't load the assemblies in its vdirs directly.  It makes copies, loads those, and then watches for changes to it's vdir  config.

    Friday, March 16, 2007 5:02 PM