Recyling apppool using msbuild script

﹥>﹥吖頭↗ 提交于 2019-12-12 13:43:38

问题


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)


回答1:


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.




回答2:


The command is

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

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



来源:https://stackoverflow.com/questions/8556139/recyling-apppool-using-msbuild-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!