使用 msbuild 脚本回收应用程序池

发布于 2024-12-22 05:23:12 字数 89 浏览 2 评论 0原文

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

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

久伴你 2024-12-29 05:23:12

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

它有一个任务:

<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Recycle" Name="MyAppP"/>

应该按照您的要求执行。

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.

一抹微笑 2024-12-29 05:23:12

该命令是

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

您可以使用 任务在 msbuild 目标中执行它。

The command is

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文