I came across this error while serializing an entity class using an XmlSerializer, and realized one of the causes for the error is when the class being serialized does not have a default (empty) constructor.
I had added a parameterized constructor to provide some syntactic sugar, and started getting the error.

So, if you get this type of error, define a default constructor to fix the serialization error.
public class foo()
{
     public foo () { }
}

Note: You can pinpoint the class by going through the chain of Inner Exceptions.

Advertisements