I'm using MSBuild to build and deploy the website, Before deploying i need to recycle the Application Pool, How can i do this from msbuild script? (I do not want to restart the IIS just recycle the application pool)
Why don't you use the extension pack: http://www.msbuildextensionpack.com/help/4.0.4.0/index.html
It has a task:
<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Recycle" Name="MyAppP"/>
That should do what you ask.
The command is
c:\Windows\system32\inetsrv\appcmd.exe recycle apppool "MyAppPool"
You can execute it within msbuild target using <Exec> task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With