I have a class that I want to de-serialize an XML-doc into:
[XmlRoot(ElementName = "MyType", Namespace = "MyNamespace")]
public class MyClass : MyBase { }
And
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[XmlTypeAttribute(Namespace = "BaseNamespace")]
[XmlRootAttribute("MyBaseType", Namespace = "BaseNamespace", IsNullable = false)]
[GuidAttribute("8d9586ec-f263-48e2-ad47-53093430bce4")]
public class MyBase { }
When deserializing I get an error saying
XML schema file with metadata not found at AAA-Fachschema.xsd":null
This is some simplified Xml:
<?xml version="1.0" encoding="utf-8"?>
<!--some comments -->
<q1:MyType xsi:schemaLocation="http://www.adv-online.de/namespaces/adv/gid/6.0 NAS-Operationen.xsd" xmlns:q1="MyNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:ogc="http://www.adv-online.de/namespaces/adv/gid/ogc" xmlns:wfs="http://www.adv-online.de/namespaces/adv/gid/wfs" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns="BaseNamespace">
</q1:MyType>
And the code deserializing:
using (var reader = new XmlReader(theFile, new XmlReaderSettings { ValidationType = ValidationType.None }))
{
var ser = new XmlSerializer(typeof(MyClass));
var o = ser.Deserialize(reader);
}
But I am not at all sure where this Xsd-file is set to be loaded by the serializer.
Does anyone know where to set this information for the serializer or even simplier how to disable the check completely?