Does possibility to specify enabled protocols for web-application in IIS exist in MSBuild?

柔情痞子 提交于 2019-12-12 13:21:54

问题


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?


回答1:


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...




回答2:


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


来源:https://stackoverflow.com/questions/3616876/does-possibility-to-specify-enabled-protocols-for-web-application-in-iis-exist-i

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