Thursday, August 11, 2011

System.Xml.Serialization.XmlSerializer.XmlSerializer() is inaccessible due to its protection level

One reason for this error is if you haven't mentioned the type when you initialize the XmlSerializer object


XmlSerializer objXmlSerializer = new XmlSerializer();

can be replaced with


XmlSerializer objXmlSerializer = new XmlSerializer(this.GetType());


0 comments: