Shared WCF client code between .NET and Silverlight apps?

Posted by Eduardo Scoz on Stack Overflow See other posts from Stack Overflow or by Eduardo Scoz
Published on 2010-03-19T18:42:52Z Indexed on 2010/03/19 18:51 UTC
Read the original article Hit count: 213

Filed under:
|
|
|
|

I'm developing a .NET application that will have both a WinForms and a Silverlight client. Although the majority of code will be in the server, I'll need to have quite a bit of logic in the clients as well, and I would like to keep the client library code the same.

From what I could figure out so far, I need to have two different project types, a class library and a Silverlight class library, and link the files from one project to the other. This seems kind of lame, but it works for simple code.

My problem, though, is that the code generated by the SVCUtil.exe to access WCF services is different from the code generated by the slsvcutil.exe, and the silverlight code is actually incompatible with the .NET one: I get a bunch of problems with the System.ServiceModel.Channel classes when I try to import the class into .NET.

Has anybody done anything similar to this before? What am I doing wrong?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about wcfservice