WCF无效操作异常

发布于 2024-09-18 07:21:45 字数 268 浏览 1 评论 0原文

我在使用 wcf 服务时遇到这个奇怪的问题 L2SQL DAL。 服务器托管在本地主机上并包含相应接口的实现。客户端熟悉该接口,偶尔会使用 TCP 传输通过公开的服务查询数据库。 当客户端在本地运行时,一切都很好。 但是,每当客户端在另一台计算机上运行时,System.Data.dll 中就会引发“InvalidOperationException”(传输仍然会被传递),并且随着时间的推移,通道会进入“故障”状态(并且传输无法传递)。 我觉得我的申请中缺少一些非常基本的东西。 有人可以指出这种奇怪行为的可能原因吗?

I encounter this strange problem while using wcf services along with
L2SQL DAL.
The server is hosted at the localhost and contains an implementation of the correspondent interface. The client is familiar with the interface and occasionally queries the database via the exposed service using tcp transport.
When client runs locally everything's just fine.
But whenever client runs at another machine the 'InvalidOperationException' is thrown in the System.Data.dll (the transport still gets delivered) and over the time the channel enters 'Faulted' state(and transport fails to get delivered).
I feel I'm missing something very basic in my application.
Could anyone please point out possible reasons for such and odd behaviour?

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

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

发布评论

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

评论(1

莫多说 2024-09-25 07:21:45

如果没有正确清理,服务中的异常将导致通道进入故障状态。请参阅:http://bloggingabout。 net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
了解如何在服务失败时清理代理。

关于 L2SQL 的问题,看起来您已经找到了解决方案。

An exception in the service will cause the channel to enter a Faulted state, if you do not clean up properly. See: http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
for how to clean up the proxy when the service fails.

On your problem with L2SQL, looks like you allready found a solution.

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