首页 > 解决方案 > Saxon EE .Net 版本评估,验证 xsd 时出现 Method not found 异常

问题描述

我使用的是 Saxon 10.5 版 .net 评估版。当试图编译 xsd 时,它会抛出错误。

找不到方法:'无效 System.IO.FileStream..ctor(System.String,System.IO.FileMode,System.Security.AccessControl.FileSystemRights,System.IO.FileShare,Int32,System.IO.FileOptions)'。

        Processor processor = new Processor(true);
        processor.SetProperty("http://saxon.sf.net/feature/timing", "true");
        processor.SetProperty("http://saxon.sf.net/feature/validation-warnings", "false"); //Set to true to suppress the exception
        SchemaManager manager = processor.SchemaManager;
        manager.XsdVersion = "1.1";
        manager.ErrorList = new List<StaticError>();
        var samplesDir = new Uri(@"C:\saxon samples\samples\");
        Uri schemaUri = new Uri(samplesDir, @"data/books.xsd");

        try
        {
            manager.Compile(schemaUri);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);

}

标签: .netstylesheetsaxon

解决方案


我的猜测是您在不受支持的 .NET 版本上运行。

请注意(由于 IKVM 交叉编译器的限制),.NET Core 目前不支持 Saxon。


推荐阅读