protected byte[] Setup() { byte[] bytes = new byte[0]; Debug = new Debug(); Debug.Initialize(); ISerializationSettings settings = SerializationContext.Default.GetService<ISerializationSettings>(); settings.ParsingMode = ParsingModeType.Loose; settings.EnsureAccurateLineNumbers = true; settings.StoreExtraSerializationData = true; DocumentProvider = new DirectoryXmlDocumentProvider(Path.Combine(Request.PhysicalApplicationPath, "icalvalidSchema")); SelectedRuleset = null; try { ResourceManager = new ResourceManager(); // Setup the language to use for validation/tests SetupLanguage(); SelectedRuleset = LoadRuleset(); } catch (ValidationRuleLoadException e) { Utils.StoreExceptionBlob("Setup: " + e.Message + e.StackTrace); bytes = Response.Output.Encoding.GetBytes(e.Message); } return bytes; }