Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recyling apppool using msbuild script

Tags:

iis-7

msbuild

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)

like image 699
Tiffany Harry Avatar asked Oct 22 '25 03:10

Tiffany Harry


2 Answers

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.

like image 80
James Woolfenden Avatar answered Oct 24 '25 10:10

James Woolfenden


The command is

c:\Windows\system32\inetsrv\appcmd.exe recycle apppool "MyAppPool"

You can execute it within msbuild target using <Exec> task.

like image 26
seva titov Avatar answered Oct 24 '25 11:10

seva titov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!