Restarting application pool when publishing WCF service

I developed a WCF web service that contains a dependency on an unmanaged DLL. When I try to publish a web application on a running server (local or remote) using Visual Studio 2010 One-Click Web Deploy, deleting the existing bin folder is due to a failure, because this unmanaged DLL is still loading into IIS memory, publish the operation. not to delete the web application folder empty, except for the restored DLL. If I manually process the IIS application pool on the server or restart IIS, I can successfully complete the publish operation.

Is there a way to automate restarting the application pool at the very beginning of the Visual Studio publishing process? The server name and the name of the web application differ depending on different web deployment profiles, just to make things interesting.

Alternative suggestions are also welcome.

Some related links I have encountered so far:
A practical guide. Deploying a Web Application Project Using Publish and One-Click Publishing
Do I need to recycle the application pool when hosting a WCF project?

+4
source share

All Articles