SharpScss
SharpScss copied to clipboard
[dotnet-sdk-9.0.100-preview.2.24113.6] SharpScss.dll causes application crash when converting scss to css
When testing 3rd party application which referring to the SharpScss nuget package with the latest .NET 9 build, it stops working after accessing page. It is caused by SharpScss.dll when converting scss to css. The exception from Visual Studio output window is: "Exception thrown: 'SharpScss.ScssException' in SharpScss.dll". Please refer to https://github.com/dotnet/runtime/issues/98646 for more reference.
Reproduction Steps Minimal Repro steps (Demo attached): ConsoleDemo.zip
The machine has dotnet-sdk-9.0.100-preview.2.24113.6 installed.
- Create a new console project.
- Install SharpScss nuget package.
- Copy the following code to Program.cs:
using SharpScss;
var result = Scss.ConvertToCss(@"@import ""foo"";", new ScssOptions()
{
OutputStyle = ScssOutputStyle.Compressed,
InputFile = "test.scss",
TryImport = (ref string file, string path, out string scss, out string map) =>
{
scss = "div {color: #FFF;}";
map = null;
return true;
}
});
var css = result.Css.Trim();
Console.WriteLine(css);
Console.ReadKey();
- Build the app.
- Change the runtime.config file to let the app run against with dotnet-sdk-9.0.100-preview.2.24113.6.
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0-preview.2.24112.33"
}
- Launch the app.
Expected behavior
Launch successfully with converted css output in command window:
Actual behavior App crashed with stop working prompt window.