C# – WCF with .NET 2.0

.net-2.0cnetwcfwindows-xp-embedded

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.

Best Answer

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