2

I've got an ASPNET Core 3.1 MVC web application. I've added a .SCSS file to the project, and installed the WebCompiler Visual Studio extension to compile the SCSS files when I build the project. I've enabled the custom build steps so that running dotnet build will run the WebCompiler and generate the .css output files.

I'm now trying to automate this via Github Actions, and WebCompiler is failing during the build:

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 5.66 sec for /home/runner/work/ndc-expo/ndc-expo/project.csproj.

  WebCompiler: Begin compiling compilerconfig.json
  WebCompiler installing updated versions of the compilers...
/home/runner/.nuget/packages/buildwebcompiler/1.12.394/build/BuildWebCompiler.targets(12,9):
   error : No such file or directory [/home/runner/work/ndc-expo/ndc-expo/project.csproj]

Build FAILED.

/home/runner/.nuget/packages/buildwebcompiler/1.12.394/build/BuildWebCompiler.targets(12,9):
  error : No such file or directory [/home/runner/work/ndc-expo/ndc-expo/project.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:07.57
##[error]Process completed with exit code 1.

Trying to replicate the build locally (Ubuntu 20.04 with dotnet sdk 3.1) gives the same error - so I'm guessing that WebCompiler just plain doesn't work on Linux... anybody know a way to enable or work around this? All the project docs say is that it has "MSBuild support for CI scenarios" - no explicit statement on whether I should expect it to work with Linux or not.

Dylan Beattie
  • 53,688
  • 35
  • 128
  • 197

1 Answers1

0

Maybe try to change to this WebCompiler as dotnet tool to compiler sass files. You can use it then with Github Actions like this:

- name: Install WebCompiler
        run: dotnet tool install Excubo.WebCompiler --global
        
- name: Run WebCompiler
        run: webcompiler //your_params_here

This tool is currently supported by authors, not like the madskristensen WebCompiler and supports newest sass syntax.

Sousuke
  • 1,203
  • 1
  • 15
  • 25