Welcome to MSDN Blogs Sign in | Join | Help

Configuring TCP Activation from the Command Line

Can I configure non-HTTP web service activation from the command line?

Yes, and you don't need any special tools if you're already familiar with configuring IIS from the command line. I've already talked about how to configure a new web site or application for activation in a previous post. Modifying the configuration uses the same appcmd program that is installed as part of the IIS scripting tools. It's installed on my system as %windir%\system32\inetsrv\appcmd.exe.

All modifications to the web site are going to start with appcmd set site sitename and all modifications to the application are going to start with appcmd set app appname. The sitename and appname are the long path name for the web site or application, such as "Default Web Site" or "Default Web Site/myapp".

The list of protocols for activation is associated with the application. Enabling an application to be activated using TCP would look like appcmd set app "Default Web Site/myapp" /enabledProtocols:net.tcp.

The protocol configuration is associated with the web site. Each protocol configuration is called a binding (not related to a WCF binding) and corresponds to a protocol scheme, IP address list, port, and host header. Not all protocol schemes are going to support all of those other things. Adding a new configuration for TCP would look like appcmd set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']. That same binding would be deleted by changing the plus to a minus, appcmd set site "Default Web Site" --bindings.[protocol='net.tcp',bindingInformation='808:*'].

Changing the IIS configuration requires administrator approval. If you don't have permission to access the configuration file, you'll get an error that looks like this:

ERROR ( message:Configuration error
Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Line Number: 0
Description: Cannot read configuration file
. )

Next time: Address Filters that Swallow GET

Published Wednesday, September 12, 2007 5:00 AM by Nicholas Allen
Filed under: , , ,

Comments

Wednesday, September 12, 2007 10:03 AM by Christian Weyer

# re: Configuring TCP Activation from the Command Line

Wednesday, September 12, 2007 10:05 AM by Jason Haley

# Interesting Finds: September 12, 2007

Wednesday, September 12, 2007 6:52 PM by Sam Gentile Personal Blog

# New and Notable 190

Please note that this blog is no longer on CodeBetter but at http://samgentile.com/blogs/samgentile/default

Friday, September 14, 2007 12:12 AM by Nicholas Allen's Indigo Blog

# Design History of Communication Objects

A common question about why so many classes implement ICommunicationObject requires a bit of a side trip

Tuesday, December 02, 2008 2:02 PM by Sam Gentile's Blog

# New and Notable 190

Please note that this blog is no longer on CodeBetter but at http://samgentile.com/blogs/samgentile/default.aspx . You do not need to do a thing as the FeedBurner feed is automagically directing you here. WCF/WF/Orcas/BizTalk/CSD Congrats to all my friends

Tuesday, December 02, 2008 8:10 PM by Sam Gentile's Blog

# New and Notable 190

Please note that this blog is no longer on CodeBetter but at http://samgentile.com/blogs/samgentile/default.aspx . You do not need to do a thing as the FeedBurner feed is automagically directing you here. WCF/WF/Orcas/BizTalk/CSD Congrats to all my friends

New Comments to this post are disabled
 
Page view tracker