I have a wcf application which is self hosted and deployed as windows Service. The application has around 30 projects and I have made a code change to one of the project and wanted to deploy the changed DLL to the test environment. Do I have to restart the service for the change to take into effect or just replace t开发者_Python百科he dll with the latest and the service will pick up the change automatically with out restart?
Thanks
It's been my experience you will need to restart the service.
You'll have to restart the service to apply changes. And I would make this application run in both service and console modes (depending on command-line arguments). It simplifies debugging a lot.
If the assembly you want to update was loaded and used by the service, you'll probably need to stop the service before you can update it.
If you want to be able to support "warm restart", you might be able to use "Shadow Copy" features of the CLR to do this. More info at: http://msdn.microsoft.com/en-us/library/ms404279.aspx
Even if you shadow copy, you'd still need to restart the service, but you could do so gracefully, much like the way that the ASP.NET / IIS runtime can start a new AppDomain to handle incoming requests while it lets the old AppDomain finish processing older requests.
精彩评论