0
votes

We have run into some problems hosting WCF on IIS (the SMSvcHost.exe Event Log ID 8 problem).

The IIS setup is as follows:

  • One IIS site, with a site binding net.tcp (binding information 808:*)
  • With a handful of applications
  • Each application running its own app pool
  • Each application hosting one net.tcp WCF service

In the web.config files, all the net.tcp bindings have portSharingEnabled="true".

Questions:

  • If I change to portSharingEnabled="false", I suspect the setup will stop working? True? (My reasoning is that there is no way that the multiple worker processes can handle the same port without port sharing)
  • If so, is a workaround to let all the applications run on the same app pool?
  • Or is port sharing a requirement for hosting net.tcp in IIS?

Now I could of course just try it out, but I currently only have a production server to test it on and want to do some research first.

1
Why do you think port-sharing and app-pool are somehow connected?nvoigt
From the question: "My reasoning is that there is no way that the multiple worker processes can handle the same port without port sharing." The multiple worker processes come from one app per app pool.codeape
From docs (docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/…): "If port sharing were not allowed and another application were already using port 808, this service would throw an AddressAlreadyInUseException when it was opened."codeape

1 Answers

1
votes

Answers to your questions:

  • Yes, it will stop working as you expect it to. Your reasoning is correct.
  • You can have multiple applications under one site (therefore in same pool) with portSharingEnabled="false". You can share that port, you'll just have different addresses as you already do. And it will work just fine:
    • net.tcp://example.com:808/FirstApp/Service.svc
    • net.tcp://example.com:808/SecondApp/Service.svc
    • net.tcp://example.com:808/ThirdApp/Service.svc
  • Port sharing is not required. But you can't share port numbers in this case.

You can try to migrace one of your applications to see how it works. Add one binding to IIS site, add second endpoint with new port to web.config and update client to see how it works. This update will require to reconfigure all client applications as well since their server will be on different port.