Updated some blog posts

by Pieter Brinkman 20. May 2009 10:28

I update two posts:

Cheers,

Pieter

Tags: ,
Categories: ASP.Net

WCF webservice error with DBML objects

by Pieter Brinkman 7. May 2009 05:34

When deploying a WCF webservice for a Silverligh application I got the following error:

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
 contract: http://tempuri.org/:IWebService ----> System.Runtime.Serialization.InvalidDataContractException: Type 'Project.service.HU_BACH.ScPlacemark' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

 

As you can see from the error you need to add the [Serializable] attribute to all objects that are used within the webservice. After I did this I got the same error for my Linq to Sql objects generated within my DBML. You can make your Linq to Sql objects serializable by changing the dbml setting Serialization Mode to Unidirectional.


Hope it helps.

Categories: ASP.Net | Linq | Silverlight