微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Saxon EE .Net 版本评估,在验证 xsd 时获取 Method not found 异常

如何解决Saxon EE .Net 版本评估,在验证 xsd 时获取 Method not found 异常

我使用的是 Saxon 10.5 版 .net 评估版。尝试编译 xsd 时抛出以下错误

找不到方法:'Void 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);

}

解决方法

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。