Search code examples
wcfiisiis-7web-deploymentnettcpbinding

how to change advance settings on IIS


I have build my WCF service deployment package using msdeploy.exe but I want to change the enabled protocols in IIS for my site at the time of installation,How can I achieve it enter image description here

I have tried setting from myservice.setParameters.xml but no success

<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="Default
     Website/myService" />
 <setParameter name="EnabledProtocols" value="net.tcp" />
 </parameters>

I want to build a one click deployment batch file for my WCF service which uses TCP binding.


Solution

  • I have solved my problem using this script

     %windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.
    [protocol='net.tcp',bindingInformation='808:*']
    
    %windir%\system32\inetsrv\AppCmd add app /site.name:"Default Web Site" /path:/testsite1
     /physicalPath:"C:\inetpub\wwwroot\testsite1"
    
    %windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/testsite1"
    /enabledProtocols:http,net.tcp