Answer
It was a configuration problem.
We had two services in the application. Prior to the problem, both services had explicit binding configuration that matched and worked well. One service was going to be removed, so the dev remmed out the explicit binding configuration, forgetting that .NET 4.0 provides default (and different) bindings.
Whichever service was hit first, its settings would not be incompatible with any other settings (since it was first) and would be fine. The service that was loaded subsequently would have different binding settings and be refused by the TransportManager.
The apparent intermittency was due to us only focusing on the one remaining service, thinking the other service was no longer in the picture. A monitoring utility was still hitting the removed service and would get in sometimes before we could reload the other service after a configuration change.
Original Question
We're getting an intermittent error when first starting up a service in IIS. If I make a whitespace change to any of the configs and reload, then about 50% of the time the service will come up fine. Once it's up, it's good to go. But the next time we deploy to this box, we start the russian roulette all over again.
We've looked over other forum posts on the same error and so far have not been able to come up with a definite fix. It took us a while to realize that none of the configuration changes we were trying were actually influencing the problem since merely a whitespace change is enough to get it to start afresh and get it to work part of the time. Seems there's some sort of race condition internally with the TransportManagerTable, perhaps it's empty when the service fails to come up? Not sure, trying to get some tracing or something to give us better info on what's in the TransportManagerTable instance.
There is no compatible TransportManager found for URI 'net.tcp://box:10101/DEV/AwesomeService.svc'. This may be because that you have used an absolute address which points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have same settings in the same application. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: There is no compatible TransportManager found for URI 'net.tcp://box:10101/DEV/AwesomeService.svc'. This may be because that you have used an absolute address which points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have same settings in the same application.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: There is no compatible TransportManager found for URI 'net.tcp://box:10101/DEV/AwesomeService.svc'. This may be because that you have used an absolute address which points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have same settings in the same application.]
System.ServiceModel.Channels.TransportChannelListener.ThrowTransportManagersNotFound() +8955459 System.ServiceModel.Channels.TransportChannelListener.SelectTransportManagers() +16199511 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) +71
System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout) +182
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +375[InvalidOperationException: The ChannelDispatcher at 'net.tcp://box:10101/DEV/AwesomeService.svc' with contract(s) '"IAwesomeService", "ILoggingService"' is unable to open its IChannelListener.]
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +16199205
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +126
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +287
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1132[ServiceActivationException: The service '/DEV/AwesomeService.svc' cannot be activated due to an exception during compilation. The exception message is: The ChannelDispatcher at 'net.tcp://box:10101/DEV/AwesomeService.svc' with contract(s) '"IAwesomeService", "ILoggingService"' is unable to open its IChannelListener..] System.Runtime.AsyncResult.End(IAsyncResult result) +890624
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +180062
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Edited the configuration to set the Address Empty and the error was fixed.
To add a little bit more instruction, the issue is most likely in the Web.Config file of your service. In the node, make sure that your Endpoint Address is an empty string -or- make sure that your Endpoint Address URL points to the exact location of your service, as you specified in IIS.
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyServiceBinding" contract="MySolution.IMyService"/>
来源:https://stackoverflow.com/questions/6112612/no-compatible-transportmanager-error