把XML轉物件的時候 遇到 doc xmlns='' was not expected
原本的code
XmlSerializer deserializer = new XmlSerializer(typeof(T)));
using (TextReader reader = new StringReader(xmlContent))
{
result = deserializer.Deserialize(reader) as T;
}
解法
XmlSerializer deserializer = new XmlSerializer(typeof(T), new XmlRootAttribute("doc")
);
如果內容有誤請多鞭策謝謝