3

我们需要在只能运行 .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 更新在 XPe 上不起作用。

有任何想法吗?

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

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

4

4 回答 4

5

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.)

于 2009-08-21T17:00:51.893 回答
2

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.)
于 2009-08-21T17:00:10.630 回答
1

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

我同意,试图将 .net 3.0 DLL“破解”到 .net 2.0 系统中听起来很痛苦。

于 2009-08-21T18:15:46.110 回答
0

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

您的选择是:

  • WCF 是为与所有 WS-* 标准一起工作而构建的。您可以使用 Web Services Enhancements (WSE) 3.0 或使用远程处理 .net 类手动编写您自己的类。
  • 你可以看看 Mono Olive。它应该是 WCF 的开源复制。
于 2009-08-21T17:16:13.797 回答