IIS7 with WCF Using Non-HTTP Bindings
One of IIS7's most powerful features is support for hosting WCF services with non-HTTP protocols like net.tcp and named pipes, combining IIS management benefits with high-performance communication protocols.
The IIS7 Advantage
In IIS6, WCF services were limited to HTTP bindings only. If you needed net.tcp, named pipes, or MSMQ bindings, you had to host services in alternative hosts like Windows Services or console applications, losing IIS management capabilities.
IIS7 Changes Everything
IIS7 introduced the Windows Process Activation Service (WAS), enabling:
- Non-HTTP Protocol Support: Host WCF services using net.tcp, named pipes, and MSMQ
- IIS Management Benefits: Keep application pool recycling, health monitoring, and process management
- Protocol Flexibility: Use optimal protocols for each scenario without sacrificing hosting infrastructure
When to Use Each Protocol
HTTP Binding (BasicHttpBinding / WSHttpBinding)
Best for:
- • Internet-facing services
- • Cross-platform interoperability
- • Firewall-friendly communication
- • Services consumed by web browsers
Net.TCP Binding
Best for:
- • Local area network (LAN) communication
- • High-performance intranet services
- • .NET-to-.NET communication
- • Binary message encoding for efficiency
Performance: 10x faster than HTTP for .NET clients on same network
Named Pipes Binding
Best for:
- • Inter-process communication (IPC) on same machine
- • Services and client on same Windows server
- • Maximum performance for local calls
- • Secure communication without network overhead
Performance: Fastest option for same-machine communication
Enabling Non-HTTP Protocols
Step 1: Enable Windows Features
Navigate to Control Panel → Programs → Turn Windows Features On or Off and ensure these components are enabled:
Required Windows Features:
- ✓ Microsoft .NET Framework 3.5 (or later)
- ✓ Windows Communication Foundation HTTP Activation
- ✓ Windows Communication Foundation Non-HTTP Activation ← Critical!
- • WCF TCP Activation
- • WCF Named Pipe Activation
- • WCF MSMQ Activation
Important Note
The "Non-HTTP Activation" features are what differentiate IIS7 from IIS6. Without these enabled, you'll only be able to use HTTP bindings, losing the primary advantage of IIS7 for WCF hosting.
Step 2: Configure IIS Site Bindings
In IIS Manager, configure your site to listen on the appropriate protocols:
IIS Manager Configuration:
- Select your application in IIS Manager
- Click "Edit Bindings" in the Actions pane
- Add bindings for the protocols you want to support:
- • HTTP:
http://localhost:8080 - • Net.TCP:
net.tcp://localhost:808 - • Named Pipe:
net.pipe://localhost
- • HTTP:
Step 3: Enable Protocols on Application
Right-click your application → Manage Application → Advanced Settings:
Enabled Protocols:
In the "Enabled Protocols" field, specify which protocols the application should accept. Protocols are comma-separated:
http,net.tcp,net.pipe
This enables HTTP, TCP, and Named Pipes simultaneously for the application
Service Configuration Example
Your WCF service web.config should define endpoints for each enabled protocol:
<system.serviceModel>
<services>
<service name="MyNamespace.MyService">
<!-- HTTP endpoint for internet access -->
<endpoint address=""
binding="wsHttpBinding"
contract="MyNamespace.IMyService" />
<!-- Net.TCP endpoint for LAN clients -->
<endpoint address="net.tcp://localhost:808/MyService"
binding="netTcpBinding"
contract="MyNamespace.IMyService" />
<!-- Named Pipe endpoint for same-machine clients -->
<endpoint address="net.pipe://localhost/MyService"
binding="netNamedPipeBinding"
contract="MyNamespace.IMyService" />
<!-- MEX endpoint for metadata -->
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
Client Configuration
Clients select which endpoint to use based on their needs:
Internet Client
http://server.com/MyService.svc
Uses HTTP for cross-network compatibility
LAN Client
net.tcp://server:808/MyService.svc
Uses TCP for high performance within the network
Local Client
net.pipe://localhost/MyService.svc
Uses Named Pipes for same-machine maximum performance
Benefits of This Approach
- Single Service, Multiple Protocols: One deployment serves all client types optimally
- Performance Optimization: LAN clients get 10x speed boost with net.tcp
- IIS Management: Leverage IIS app pools, monitoring, and health management
- Simplified Operations: No separate Windows Service hosting infrastructure
Troubleshooting Common Issues
Service Not Activating on net.tcp
Solution:
- • Verify "Net.Tcp Listener Adapter" Windows service is running
- • Check that net.tcp is in the "Enabled Protocols" list
- • Ensure site binding includes correct net.tcp port
Protocol Not Found in Enabled Protocols List
Solution:
- • Install "WCF Non-HTTP Activation" Windows features
- • Restart IIS after installing features
- • Verify .NET Framework 3.5+ is installed
Modern Context
Note: This article from 2010 describes WCF hosting in IIS7, which remains relevant for maintaining legacy WCF services. Modern applications typically use ASP.NET Core with gRPC for high-performance scenarios (similar to net.tcp benefits) and REST APIs for web services. However, the concepts of protocol optimization and managed hosting infrastructure remain fundamental to service architecture. Organizations still running WCF services can continue using these techniques, or consider migrating to CoreWCF which brings WCF to .NET Core with similar IIS hosting capabilities.