WCF 与 .NET 2.0

发布于 2024-08-03 00:34:59 字数 878 浏览 5 评论 0原文

我们需要在只能运行.NET 2.0的机器上实现WCF服务。

该机器是Windows XPe POS终端,我们还没有找到安装.NET 3.0的方法。我们无法真正使用新的 XPe 映像对其进行格式化,因为安装了专有的 POS 应用程序和驱动程序。

有没有办法在.NET 2.0上实现WCF服务?我们可以像 .NET CF 那样使用标准 XmlSerializer 来处理消息,但是 .NET CF不支持成为服务器...

替代解决方案是以某种方式安装.NET 3.0。安装程序抱怨 Windows XP SP2 未安装,并且 Windows Update 无法运行XPe。

有什么想法吗?

更新:我们还希望可以选择使用 SOAP Web 服务,但我们的目标平台不支持已安装 IIS。有谁知道在没有 IIS 的情况下托管 .NET 2.0 Web 服务的好(生产质量)方法吗?

解决方案:我们将 Cassini 与 .NET 2.0 Web 服务结合使用,作为建议的标记答案。到目前为止,这似乎运作良好。感谢您的帮助。

We need to implement a WCF service on a machine that can only run .NET 2.0.

The machine is a Windows XPe POS terminal, and we have not found a way to install .NET 3.0. We can't really format it with a new XPe image because there is a proprietary POS application and drivers installed.

Is there a way to do implement a WCF service on .NET 2.0? We can use the standard XmlSerializer for the messages as .NET CF does, but .NET CF doesn't support being a server...

An alternate solution is to somehow install .NET 3.0. The setup complains about Windows XP SP2 not being installed, and Windows Update doesn't work on XPe.

Any ideas?

UPDATE: We would also like the option to use SOAP web services, but our target platform does not have IIS installed. Does anyone know a good (production quality) way to host a .NET 2.0 web service without IIS?

SOLUTION: We are using Cassini with .NET 2.0 web services as the marked answer suggested. This seems to be working well thus far. Thanks for the help.

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

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

发布评论

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

评论(4

红墙和绿瓦 2024-08-10 00:34:59

听起来你已经用尽了大部分可能性。您是否有任何理由必须使用 WCF 而不是 .NET 2.0 支持的开箱即用的普通 SOAP Web 服务?虽然我知道使用旧技术令人沮丧,但我怀疑,与在 .NET 2.0 上拼凑出 WCF 实现相比,沿着相对主流的道路走下去会遇到更少的问题。

(我强烈建议反对尝试在 .NET 2.0 上使用 .NET 3.0 程序集。它很可能违反许可证 - 您必须检查 - 但它也可能以微妙的方式破坏,从而导致毕竟,谁确切知道 .NET 3.0 安装程序在做什么?您想追踪它可能得到的每个注册表项吗?放弃它,但我认为这是一个坏主意。)

It sounds like you've exhausted most of the possibilities. Is there any reason you have to use WCF instead of the plain SOAP web services that .NET 2.0 supports out of the box? While I understand it's frustrating to use the older technology, I suspect you'll have fewer problems by going down the relatively mainstream path than somehow cobbling together a WCF implementation on .NET 2.0.

(I would strongly recommend against trying to use the .NET 3.0 assemblies on .NET 2.0. It may well violate the licence - you'd have to check - but it could also break in subtle ways that would be very hard to debug. After all, who knows exactly what the .NET 3.0 installer is doing? Do you want to chase down every registry key it writes? You may get away with it, but I think it's a bad idea.)

向地狱狂奔 2024-08-10 00:34:59

我可以想到两种可能性:

  1. 尝试将应用程序使用的许多 dll 链接到单个 exe 中的系统之一。
    这里描述了这些工具之一:http://www.remotesoft.com/linker/linker_faq。 .NET 3.0主要
  2. 是添加到 .NET 2.0 中的一些新 dll(WPF、WCF 和 WF)。您可能只需将适当的 dll 与您的应用程序一起复制即可。 (有些人认为这是一个危险的想法,但在你尝试之前你不会真正知道。)

I can think of two possibilities:

  1. Try one of the systems that will link the many dlls used by your app into a single exe.
    One of these tools is described here: http://www.remotesoft.com/linker/linker_faq.html
  2. .NET 3.0 was mostly a few new dlls (WPF, WCF, and WF) added into .NET 2.0. You can probably get away with merely copying the appropriate dlls along with your app. (Several people think this is a dangerous idea, but you won't really know until you try it.)
耳钉梦 2024-08-10 00:34:59

不能在中间放一个“代理”吗?因此,您的 POS 使用 SOAP/ASMX 与代理通信,然后代理与 WCF 服务通信。

我同意,尝试将 .net 3.0 DLL“破解”到 .net 2.0 系统听起来像是一个痛苦的世界。

Can't you put a "Proxy" in between? So your POS talks to the Proxy using SOAP/ASMX and the Proxy then talks to the WCF Service.

I agree, trying to "hack" .net 3.0 DLLs into a .net 2.0 system sounds like a world of pain.

伴我心暖 2024-08-10 00:34:59

答案是否定的。您无法在 2.0 系统上安装或以某种方式使用 WCF

您的选项是:

  • WCF 旨在与所有 WS-* 标准配合使用。您可以使用 Web 服务增强 (WSE) 3.0 或使用远程 .net 类手动编写您自己的类。
  • 你可以看看单橄榄。它应该是 WCF 的开源复制。

The answer is no. You cannot install or somehow use WCF on a 2.0 system

Your options are:

  • WCF is built to work with all WS-* standards. You may use Web Services Enhancements (WSE) 3.0 or hand code your own class using remoting .net classes.
  • You may look at Mono Olive. It is supposed to be open source replication of WCF.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文