0
votes

I am facing an issue while calling wcf service. Error :

The IXmlSerializable type 'System.Xml.Linq.XElement' cannot be deserialized in partial trust because it does not have a public parameterless constructor.

My website (asp.net) and wcf service is deployed at godaddy hosting. Same code is working fine in my local environment but dont know why its not working after deployment. I tried to google it and found few different solutions but none them helped me. Some of the methods of this WCF service is working fine, like its allowing me to validate user (Login), fetching User information etc... but on 2 other pages when website is trying to call wcf service its getting above mentioned error.

Any help will be appreciated

Thanks in Advance

why XElement instead of XmlElement?Sheng Jiang 蒋晟
I am not at all using any of XElement or XmlElement, I am getting this error when I am calling WCF service method which should return a custom modal object.Vijay Sutaria
check if you are reusing types in referenced assemblies... if so, maybe switching from System.Xml.Linq to System.Xml.Sheng Jiang 蒋晟