C# – WCF service (.NET 4.0) can have a .NET 2.0 client

.net-2.0.net-4.0cwcf

The scenario is like this:
I have a .NET 4.0 client-Server application that works fine.
I need to create a UserControl that can access the Server, but it needs to be created in .NET 2.0 (because customer application is .NET 2.0)

Does it exist a way to access .NET 4.0 WCF service from a 2.0 client?

NOTE:
it is not a Web service, but a standalone .exe server
No autentication used
Data transfered are almost basic (class with arrays and basic types within)
it uses client callbacks so protocol il net.tcp
optionally I can change protocol if I can still be able to use callbacks

Best Answer

You need to expose the WCF as a Web Service:

The you work as if it was a good old .asmx service (add reference and so on).

It doesn't matter if your WCF service is hosted in a .exe, a web app, a windows service...

Supporting callbacks is not possible in .NET 2.0 with .asmx services, so that you have to simulate a callbak using something like TcpListener and TcpClient.

Unfortunately this has to de done from scratch, but you can use the logic in the WCF implementation.