Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Compile on build" fails with dotnet publish #328

Open
martinRocks opened this issue Sep 12, 2017 · 1 comment
Open

"Compile on build" fails with dotnet publish #328

martinRocks opened this issue Sep 12, 2017 · 1 comment

Comments

@martinRocks
Copy link

martinRocks commented Sep 12, 2017

Installed product versions

  • Visual Studio: 2017 15.3.3
  • This extension: 1.11.326

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

  1. create a web project in core 2.0
  2. add a scss file
  3. click on the file and click on compile file
  4. change the output path to wwwroot
  5. click on the compilerconfig.json file and click enable compile on build
  6. run the publish script from above

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.

@joakimriedel
Copy link

See #321 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants