WCF in IIS Gotcha: Enable the Right Protocols

Sometimes tough problems have simple (usually overlooked) solutions. If you find that you have WCF code that executes well in the Visual Studio web server only to fail to load in IIS, you may have a protocol problem. I tried running a service that supported multiple protocols only to find this exception when loading to IIS 7:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

You may not think about it much, because most of us are used to running all our IIS stuff using only HTTP.  One nice thing about WCF however, is that a single service can support multiple protocols (in this case netTcp and wsHttp).  But IIS must have all protocols registered so when my service, which also supports netTcp, tried to execute in IIS it fails to load.

It’s a simple fix.  Here’s all you need to do:

  1. In IIS, right-click your application.
  2. Select “Manage Application | Advanced Settings…”
  3. Add “,net.tcp”  (leaving off the quotes) to the end of the text in the “Enabled Protocols”

Your application should work after this.

Advertisements

About Ed Jones

Ed is a .NET and Integration architect for Avanade in the Twin Cities. Contact Ed

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: