Index: Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs =================================================================== diff -u -r9adb7863b832fbef7249803d20750688061c846e -r8a00046f9112833f25944b0f2631c7003f7a1692 --- Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs (.../ConfigurationReader.cs) (revision 9adb7863b832fbef7249803d20750688061c846e) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs (.../ConfigurationReader.cs) (revision 8a00046f9112833f25944b0f2631c7003f7a1692) @@ -23,6 +23,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net; +using System.Text; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; @@ -146,7 +148,10 @@ /// Thrown when the provided XML document does not match the provided XML Schema Definition (XSD). private static void ValidateToSchema(XDocument document, string schemaString, string xmlFilePath) { - var xmlSchemaSet = new XmlSchemaSet(); + var xmlSchemaSet = new XmlSchemaSet + { + XmlResolver = new XmlResourcesResolver() + }; try { @@ -213,5 +218,31 @@ return new ReadCalculationGroup(folderElement.Attribute(ConfigurationSchemaIdentifiers.NameAttribute)?.Value, ParseElements(folderElement.Elements())); } + + private class XmlResourcesResolver : XmlResolver + { + public override ICredentials Credentials + { + set + { + throw new NotImplementedException(); + } + } + + public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) + { + switch (Path.GetFileName(absoluteUri.ToString())) + { + case "ConfiguratieSchema.xsd": + return new MemoryStream(Encoding.UTF8.GetBytes(Resources.ConfiguratieSchema)); + case "StochastSchema.xsd": + return new MemoryStream(Encoding.UTF8.GetBytes(Resources.StochastSchema)); + case "HrLocatieSchema.xsd": + return new MemoryStream(Encoding.UTF8.GetBytes(Resources.HrLocatieSchema)); + } + + return null; + } + } } } \ No newline at end of file