Under Silverlight only public types may be serialized with the DataContractSerializer. If you want to make your data classes internal to your assembly and serialise them for use in a WCF service you will find that the service call will fail at runtime with a SecurityException inside a misleading exception about inability to communicate with the service. There is a workaround however which involves exposing your internal types to the Silverlight base class libraries with the InternalsVisibleTo attribute. Simply add the following code to your AssemblyInfo.cs file:-
If you use the DataContractJsonSerializer you must also add the System.Servicemodel.Web assembly (the public key is the same).