svcutil 因服务故障而失败

发布于 2024-08-05 20:21:24 字数 524 浏览 4 评论 0原文

我们有一个 WCF 自托管服务,我们已经开发了一段时间了。作为我们标准的一部分,我们定义了一个应用于操作的故障契约。

最近我们需要添加一个新的 ServiceContract,因此我们这样做了并向其添加了一个简单的方法(void/no params)。一旦我们添加了这个合约,SVCUtil 将不再为我们生成代理。相反,它会出错并说元数据包含无法解析的引用:“net.tcp://localhost/MyService”没有端点侦听等等。

我们最终调试到操作合约有故障合约。一旦我们将其删除,一切都会正常。这对我们来说非常奇怪,因为..

1) 新的服务合同与我们所有其他服务合同位于同一位置

2) the implementer of the service contract is the same as the implementer of all other service contracts (don't ask)

3)FaultContract 与我们在其他地方使用的相同。

有什么想法可能导致这种奇怪的行为吗?

We have a WCF self hosted service which we have been developing for awhile. As part of our standard we have defined a FaultContract which we apply to operations.

Recently we needed to add a new ServiceContract so we did that and added a simple method (void/no params) to it. Once we added this contract though SVCUtil would no longer generate a proxy for us. Instead it would error out and say that the Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/MyService' There is no endpoint listening blah blah blah.

We finally debugged it to the fact that the operation contract has the faultcontract. As soon as we remove it everything works fine. This to us is very strange because..

1) the new service contract is in the same location as all our other service contracts

2) the implementer of the service contract is the same as the implementer of all other service contracts (don't ask)

3) The FaultContract is the same as the one we use everywhere else.

Any thoughts on what could be causing this weird behavior?

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

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

发布评论

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

评论(1

睡美人的小仙女 2024-08-12 20:21:24

事实证明不是FaultContracts的错。相反,使用 mex 的 netTcp 绑定会出现问题。当你达到一定数量的方法之后,它就不再起作用了。解决方案是切换到 http 绑定。

Turned out to not be FaultContracts fault. Instead there is a problem with using the netTcp binding for mex. After you reach a certain number of methods it just doesn't work anymore. Solution was to switch to an http binding.

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