Script blocks are supported only in .NET Framework. They are not supported on .NET Core or .NET 5 or later. (Workaround)

112 views Asked by At

I know there is already a similar questions regarding this concern but those are already at least a year old.

I know also that this functionality is still not supported in .NET6 so what I am asking here is a workaround as we are currently converting our .NET framework codes to .NET6.

XslCompiledTransform xslt = new XslCompiledTransform();
XsltSettings sets = new XsltSettings(true, true);
var resolver = new XmlUrlResolver();


var styleSheetUri = @"C:\Users\xxxxx\buildCardtypeProd.xslt";
//the line below is throwing an exception (XSLT compile error; Compiling jscript/ csharp scripts is not supported in .net core)
xslt.Load(styleSheetUri, sets, resolver);

I already tried the nugets below but it is still throwing the same exception.

  1. Mvp.Xml
  2. Mvp.Xml.NetStandard
0

There are 0 answers