XslCompiledTransform.Load(type) : Could not load file or assembly 'System.Data.SqlXml

雨燕双飞 提交于 2019-12-24 08:55:45

问题


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

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);

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

Is there anything I am missing, please help.


回答1:


.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.

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.



来源:https://stackoverflow.com/questions/51881887/xslcompiledtransform-loadtype-could-not-load-file-or-assembly-system-data-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!