没有兼容的 TransportManager 错误

发布于 2024-11-09 07:20:07 字数 3208 浏览 0 评论 0原文

回答

这是一个配置问题。

我们的应用程序中有两项服务。在出现问题之前,这两个服务都具有匹配且运行良好的显式绑定配置。一项服务将被删除,因此开发人员重新删除了显式绑定配置,忘记了 .NET 4.0 提供了默认(和不同的)绑定。

无论哪个服务首先被命中,它的设置都不会与任何其他设置不兼容(因为它是第一个),并且会很好。随后加载的服务将具有不同的绑定设置并被 TransportManager 拒绝。

明显的间歇性是由于我们只关注剩余的一项服务,认为另一项服务不再出现在图中。监控实用程序仍在访问已删除的服务,并且有时会在我们在配置更改后重新加载其他服务之前进入。



原始问题

首次在 IIS 中启动服务时,我们遇到间歇性错误。如果我对任何配置进行空白更改并重新加载,那么大约 50% 的时间服务会正常运行。一旦它起来了,就可以走了。但下次我们部署到这个盒子时,我们会重新开始俄罗斯轮盘赌。

我们查看了其他论坛上有关同一错误的帖子,但到目前为止还无法找到明确的解决方案。我们花了一段时间才意识到,我们尝试的任何配置更改都没有真正影响问题,因为仅仅空白更改就足以让它重新启动并使其在部分时间工作。 TransportManagerTable 内部似乎存在某种竞争条件,当服务无法启动时它可能是空的?不确定,尝试进行一些跟踪或其他操作来为我们提供有关 TransportManagerTable 实例中内容的更好信息。


没有找到 URI“net.tcp://box:10101/DEV/AwesomeService.svc”的兼容 TransportManager。这可能是因为您使用了指向虚拟应用程序外部的绝对地址,或者端点的绑定设置与其他服务或端点设置的设置不匹配。请注意,同一协议的所有绑定在同一应用程序中应具有相同的设置。 描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.InvalidOperationException:找不到 URI“net.tcp://box:10101/DEV/AwesomeService.svc”的兼容 TransportManager。这可能是因为您使用了指向虚拟应用程序外部的绝对地址,或者端点的绑定设置与其他服务或端点设置的设置不匹配。请注意,同一协议的所有绑定在同一应用程序中应具有相同的设置。

来源错误: 执行当前 Web 请求期间生成未处理的异常。有关异常来源和位置的信息可以使用下面的异常堆栈跟踪来识别。

堆栈跟踪:

[InvalidOperationException:没有兼容的 TransportManager 找到 URI“net.tcp://box:10101/DEV/AwesomeService.svc”。这可能 是因为你使用了指向外部的绝对地址 虚拟应用程序的或端点的绑定设置 与其他服务或端点设置的不匹配。 请注意,同一协议的所有绑定应具有相同的设置 在同一个应用程序中。]
System.ServiceModel.Channels.TransportChannelListener.ThrowTransportManagersNotFound() +8955459 System.ServiceModel.Channels.TransportChannelListener.SelectTransportManagers() +16199511 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback 选择TransportManagerCallback)+71
System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan 超时)+182
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan 超时)+789
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan 超时)+375

[InvalidOperationException:ChannelDispatcher 位于 带有合约的“net.tcp://box:10101/DEV/AwesomeService.svc” “IAwesomeService”、“ILoggingService”无法打开其 IChannelListener。]
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan 超时)+16199205
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan 超时)+789 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan 超时)+126
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan 超时)+789
System.ServiceModel.HostingManager.ActivateService(字符串 规范化虚拟路径)+287
System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串 规范化虚拟路径)+1132

[ServiceActivationException:服务“/DEV/AwesomeService.svc” 编译时出现异常,无法激活。这 异常消息是: ChannelDispatcher at 带有合约的“net.tcp://box:10101/DEV/AwesomeService.svc” “IAwesomeService”、“ILoggingService”无法打开其 IChannelListener..] System.Runtime.AsyncResult.End(IAsyncResult 结果)+890624
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果)+180062
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)+107

版本信息:Microsoft .NET Framework 版本:4.0.30319; ASP.NET版本:4.0.30319.1

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) +107

Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡看悲欢离合 2024-11-16 07:20:07

编辑配置以将地址设置为空,错误已修复。

Edited the configuration to set the Address Empty and the error was fixed.

很快妥协 2024-11-16 07:20:07

要添加更多指令,问题很可能出在您服务的 Web.Config 文件中。在该节点中,确保您的端点地址为空字符串,或者确保您的端点地址 URL 指向您在 IIS 中指定的服务的确切位置。

<endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyServiceBinding" contract="MySolution.IMyService"/>

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"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文