You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a web project using core 2.0. I have a few scss files that I told to compile on built. The compilerconfig.json is below. In development mode, everything works perfectly. However, when I build the project to deploy it onto another server, it throws the below error. I use dotnet publish to create the files I need like below.
---Error
C:\Users\xxx.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9): error MSB4062: The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\xxx.nuget\packages\buildwebcompiler\1.11.326\build..\tools\WebCompiler.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\xxx\Documents\Work\WebProject\WebProject.Web\WebProject.Web.csproj]
Installed product versions
Description
I have a web project using core 2.0. I have a few scss files that I told to compile on built. The compilerconfig.json is below. In development mode, everything works perfectly. However, when I build the project to deploy it onto another server, it throws the below error. I use dotnet publish to create the files I need like below.
---Error
C:\Users\xxx.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9): error MSB4062: The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\xxx.nuget\packages\buildwebcompiler\1.11.326\build..\tools\WebCompiler.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\xxx\Documents\Work\WebProject\WebProject.Web\WebProject.Web.csproj]
---Publish script
dotnet restore
dotnet publish -o ../build .\WebProject.Web\WebProject.Web.csproj -c Release
Steps to recreate
Current behavior
dotnet publish throws an error. If I remove the enable compile on build option, the publish script works just fine.
Expected behavior
dotnet publish works just like the when I run the project in VS.
The text was updated successfully, but these errors were encountered: