I use net.tcp to access my services for various reasons. Everytime I have to deploy a service to an IIS 7 instance, I always have to look up and figure what commands to run. Now I’m just going to post them here for easy reference.

The first command tells IIS to add the net.tcp binding to the specific website. If you’re only using the ‘Default’ website then you would replace ‘WebSiteName’ with ‘Default’ or whatever the name of your site is.

%systemroot%\System32\inetsrv>appcmd set site "WebSiteName" -+bindings.[protocol='net.tcp',bindingInformation='808:*']

The second command that you have to run enables the protocol for use with your application. In this command you replace ‘WebSiteName’ with the name of your website, as you did above. ‘AppName’ is the name of the application (Website->Add Application). If you did not create an application under your site you can leave it blank.

With Application:

%systemroot%\System32\inetsrv>appcmd set app "WebSiteName/AppName" /enabledProtocols:http,net.tcp

Without Application:

%systemroot%\System32\inetsrv>appcmd set app "WebSiteName/" /enabledProtocols:http,net.tcp

 And thats it.

Advertisements