I'm working on a web solution in Visual Studio 2010 that is using IIS Express to host the application. I want the build process to copy the output DLLs from some of the projects into a directory under the main web app. There is a watch on this directory that keeps MEF current. The problem is that my builds fail because they can't copy the dlls over the existing ones because the application is left running every time I debug. What I'd like to do is add a build command that stops the site before the build begins.
I was expecting to be able to run AppCmd Stop Site "MySiteName" but appcmd says that STOP is not supported for site objects.
Are there any ways to stop a site from running in iis express from the command line?
Option-1:
If you don't have any other sites running, try
"taskkill /IM iisexpress.exe"
Note: This stops all iisexpress.exe processes
Option-2:
Write some executable utility for doing this. Following link may help you! Starting and stopping IIS Express programmatically