koenvzeijl / AspNetCore.SassCompiler

Sass Compiler Library for .NET Core 3.1/5.x/6.x/7.x without node, using dart-sass as a compiler
https://www.nuget.org/packages/AspNetCore.SassCompiler/
MIT License
206 stars 26 forks source link

Does not work on IIS #193

Open gumbarros opened 1 month ago

gumbarros commented 1 month ago

Describe the bug Des not work on IIS. When attempting to use the SassCompiler with an ASP.NET Core application hosted on IIS, the compiler fails to process Sass files.

To Reproduce Steps to reproduce the behavior:

  1. Set up an ASP.NET Core application.
  2. Install and configure the SassCompiler as per the documentation.
  3. Deploy the application to IIS.
  4. Attempt to load a page that uses Sass styles.
  5. Page does not load

Expected behavior The SassCompiler should correctly process Sass files into CSS when the application is hosted on IIS, without any errors.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context This issue occurs specifically when hosting the application on IIS. It works as expected when running locally using Kestrel.

sleeuwen commented 1 month ago

Hi @gumbarros ,

I don't have access to a server running IIS, but if I add the property <SassCompilerIncludeRuntime>true</SassCompilerIncludeRuntime> to my csproj, then run dotnet publish -c Release -o publish, I do see that the sass executables is copied to the publish directory and it can run the sass file watcher without issues.

As long as the sass executables (dart.exe and sass.snapshot in the runtimes/- folder) are available then it should work. And as far as I can see, it does work when running a published project in release mode via Kestrel.