I am validating and Xdocument to and xsd file and everything works fine, but when I add the Xsd file to the XmlSchemaSet object it takes like one minute and a half to load, the schema is not small but only occupies 50kb which in my opinion shouldn't take that much to load. I have tried with other smaller xsd files and load in 1ms. Also tried as an embedding resource with same results. Do I have something wrong or is there a way to have the Xmlschemaset loaded somehow as a class so it doesn't loads every time, any help will be greatly appreciated.
Here is the code
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add(null, "c:\\temp\\GT_Documento-0.2.0.xsd");
XDocument xml = XDocument.Load("c:\\temp\\xmlinvoice.xml");
xml.Validate(schemaSet, ValidationCallback);
Xsd link:
https://github.com/fel-sat-gob-gt/cat/blob/desa/xsd/GT_Documento-0.2.0.xsd