Xml Deserialization Error
See original GitHub issueI am getting this error when deserializing an XML string with version 2.1.2:
An attempt was made to load a type with the fully qualified name of ‘http://namespace/file.xsd:myMessage’, but no type could be located with that name.
XML:
<?xml version="1.0"?>
<myMessage xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://namespace/file.xsd">
<myElement uniqueId="12345">
</myMessage>
Class:
// <remarks />
[Serializable]
[XmlType(AnonymousType = true, Namespace = "http://namespace/file.xsd")]
[XmlRoot("myMessage", Namespace = "http://namespace/file.xsd",
IsNullable = false)]
public class MyMessage
{
/// <remarks />
[XmlElement("myElement")]
public MyElementType MyElement { get; set; }
}
Call to the serializer:
_xmlSerializer.Deserialize<MyMessage>(xml)
Possibly related to #99
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (16 by maintainers)
Top Results From Across the Web
c# - Deserialization error in XML document(1,1)
(1,1) means basically first char of the first line is incorrect and the string can't be deserialized. Share.
Read more >How to debug XMLSerializer.Deserialize error : 'There is ...
If the serializer cannot match the document with the type passed to the constructor, the type specified by the XmlInclude attribute, or the...
Read more >there is an error in XML document (2, 2)
Hi FranzBe, When I serialize the declared object and then Deserialize then it is working as expected. However, I have modified the code...
Read more >Regarding the case where Deserialize fails without ...
This is a problem related to Serialize and Deserialize of XmlSerializer. For a certain XML file, save it with [Code Flagment 1] and...
Read more >XML Deserialization Error occurs when using SAP WS ...
XML Deserialization Error occurs when using SAP WS Navigator to consume Query as a Web Service in SAP BI 4.x; Error details is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For sure @wojtpl2 … looks like d4d99cc633217f473a9e32e0fb7042892f6369f3 is the winner here. 👍
I’ve just published version 2.1.2.