1
votes

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

1 Answers

0
votes

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