Partager via


Mapping to a VDir

When I run my non-HTTP service in IIS, I get an error message that the protocol is not supported. How do I add non-HTTP support to my VDir?

This is a two step process because the web site controls the list of available protocols while the application controls which of those protocols are enabled. You can change these settings either from the IIS control panel or from the command line. I'll demonstrate setting this up with the command line. This assumes that you've installed the IIS scripting tools and have started an elevated command prompt.

The first step is to create a web site that has the protocol in its list. I'll be using net.msmq in this example. If you've already got a web site, then you'll be using set instead of add and change the command accordingly.

 appcmd add site /name:"My Site" /physicalPath:"c:\mysite" /bindings:http/*:80:,net.msmq/*

The second step is to create an application that has the protocol enabled. Again, if you've already got an application, then you'll be using set instead of add.

 appcmd add app /site.name:"My Site" /path:/myapp /physicalPath:"c:\mysite\myapp" /enabledProtocols:http,net.msmq

Next time: Channel Bindings

Comments

  • Anonymous
    March 16, 2007
    Does this apply to IIS6/Windows2003/XP or IIS7/Longhorn/Vista? My previous understanding was that you have to do WCF service self-hosting on Windows2003/XP when HTTP is not used. Can IIS7/WAS run on Widnows2003/XP? Thanks for clarification. One of your blog subscribers, Kevin

  • Anonymous
    March 16, 2007
    How does my service know the identity of one of the connecting clients? I'm going to focus this answer

  • Anonymous
    March 16, 2007
    This applies to IIS7, which is available on Vista/LHS only.

  • Anonymous
    March 16, 2007
    Thanks for the quick answer.

  • Anonymous
    September 13, 2007
    The comment has been removed