I have a Silverlight application with a Silverlight-enabled WCF service. The service passes along a small POCO class with a few string properties, and a List<> of an enum defined in the class. Everything works fine when running using the ASP.NET development server, but when I move the service over to an IIS server (Windows 2003) I get the following error when I try to browse the .svc file:
Type ‘MyProject.Web.MyClass’ cannot be
serialized. Consider marking it with
the DataContractAttribute attribute,
and marking all of its members you
want serialized with the
DataMemberAttribute attribute.
Even though it’s working development side, I’ve tried adding the decorations… but so far without effect.
Any ideas as to what might be causing this difference of outcomes between development workstation and server?
Make sure that (1) the .NET Framework 3.5 SP1 is installed on the server and (2) that the website is running in ASP.Net 2.0 mode and not 1.1 mode.
The Web Platform Installer is an easy way to install the updated framework if it isn’t already installed.