本文介绍了XslCompiledTransform.Load(type):无法加载文件或程序集'System.Data.SqlXml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在.net core 2.0解决方案中加载已编译的XSL(使用XSLTC.exe),但出现以下错误。

I am trying to load compiled XSL (using XSLTC.exe) in my .net core 2.0 solution but getting below error.

System.IO.FileNotFoundException:'无法加载文件或程序集'System.Data.SqlXml,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089'。系统找不到指定的文件。’

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.'

 Assembly asm = Assembly.LoadFrom(@"...");
 Type t = asm.GetType("...");
 myXslTransform.Load(t);

文档说,它应该加载从XSLTC.exe生成的文件,但不起作用。

The documentation says that, it should load file generated from XSLTC.exe but not working.

有什么我想念的,请帮忙。

Is there anything I am missing, please help.

推荐答案

.NET Core没有System.Data.SqlXml或当前等效的Microsoft.Data.SqlXml作为现成或现成的程序集程序包。包含可读取普通SqlXml数据的SqlXml类的程序包/组件.NET Core是System.Data.SqlClient,可在.NET Core 1.0或更高版本中使用。

.NET Core does not have System.Data.SqlXml or current equivalent Microsoft.Data.SqlXml as an in box or out of box assembly package. Package/assembly .NET Core which contains SqlXml class allowing to read plain SqlXml data is System.Data.SqlClient and is available in .NET Core 1.0 or later.

您需要使用Microsoft.Data.SqlXml的更多高级功能,而.NET Framework和.NET Core均未安装。当前获得它的最佳方法是通过安装SQLXML 4.0 SP1软件包-最新的Mirosoft.Data.SqlXml版本最可能是4.0.3。从SQL Server 2008开始,SQL Server不包括最新版本的SQLXML。

To get more advanced functionality you need to use Microsoft.Data.SqlXml which is not installed neither with .NET Framework nor .NET Core. Currently best way to get it is via installing SQLXML 4.0 SP1 package - latest Mirosoft.Data.SqlXml version is most probable 4.0.3. Beginning with SQL Server 2008, the latest version of SQLXML is not included in SQL Server.

这篇关于XslCompiledTransform.Load(type):无法加载文件或程序集'System.Data.SqlXml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 04:48