MSBuild 中是否可以为 IIS 中的 Web 应用程序指定启用的协议?

发布于 2024-09-16 11:47:34 字数 298 浏览 5 评论 0原文

我使用 MSBuild 任务在 IIS 中创建 Web 目录:

<WebDirectoryCreate
   VirtualDirectoryName="$(VirtualDirectoryName)"
   VirtualDirectoryPhysicalPath="$(VirtualDirectoryPath)"
   AccessExecute="true"/>

现在,我寻找使用 MSBuild 为此 Web 目录指定启用的协议(http、https、net.tcp)的可能性。有什么建议吗?

I create webdirectory in IIS, using MSBuild task:

<WebDirectoryCreate
   VirtualDirectoryName="$(VirtualDirectoryName)"
   VirtualDirectoryPhysicalPath="$(VirtualDirectoryPath)"
   AccessExecute="true"/>

Now I look for possibility to specify enabled protocols (http, https, net.tcp) for this webdirectory using MSBuild. Any suggestion?

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

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

发布评论

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

评论(2

避讳 2024-09-23 11:47:34

没有运气找到任何自定义 MSBuild 任务来处理上述操作。无论如何,我仍然可以使用 appcmd.exe 来执行此操作:

事实上,我现在甚至找不到运行我的 msbuild 任务的人没有安装 appcmd.exe 的情况:) 嗯...好吧...无论如何...

Had no luck to find any custom MSBuild task to handle above described action. Anyway I can still use appcmd.exe in order to do that:

<Exec Command='%systemroot%\system32\inetsrv\appcmd set app "Default Web Site/WebAppName" /enabledProtocols:http,net.pipe,net.tcp'></Exec>

In fact I can't even find case now where person running my msbuild task has no appcmd.exe installed :) hm... ok... whatever...

不醒的梦 2024-09-23 11:47:34

对答案的一个小修正是,您的网站名称后面必须带有斜杠:

%systemroot%\system32\inetsrv\appcmd set app "MySite/" /enabledProtocols:http,net.pipe,net.tcp

A minor correction to the answer, your site name must be followed by a slash:

%systemroot%\system32\inetsrv\appcmd set app "MySite/" /enabledProtocols:http,net.pipe,net.tcp
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文