使用msbuild脚本重新使用apppool

Tif*_*rry 3 msbuild iis-7

我正在使用MSBuild来构建和部署网站,在部署之前我需要回收应用程序池,如何从msbuild脚本执行此操作?(我不想重启IIS只是回收应用程序池)

sev*_*tov 6

命令是

c:\Windows\system32\inetsrv\appcmd.exe recycle apppool "MyAppPool"
Run Code Online (Sandbox Code Playgroud)

您可以使用<Exec>任务在msbuild目标中执行它.


Jam*_*den 5

为什么不使用扩展包:http: //www.msbuildextensionpack.com/help/4.0.4.0/index.html

它有一个任务:

<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Recycle" Name="MyAppP"/>
Run Code Online (Sandbox Code Playgroud)

那应该按你的要求做.