C# XmlSerializer BindingFailure

前端 未结 4 1770
执念已碎
执念已碎 2020-12-08 06:29

I get a BindingFailure on a line of code using the XmlSerializer:

XmlSerializer s = new XmlSerializer(typeof(CustomXMLSerializeObject));
4条回答
  •  广开言路
    2020-12-08 06:52

    According to MS VS 2010 Feedback this is how it was designed. In order to prevent this exception and prevent a slow-down during run-time execution you need to generate a XML Serializer assembly.

    There are three tools I could find: Microsoft SGen, XGenPlus and Mvp.Xml.XGen. As of this post, unfortunately, none of these has been updated since 2007.

提交回复
热议问题