question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't run Desktop-Compiled MsBuild tasks installed from NuGet

See original GitHub issue

Steps to reproduce

  • Create empty Web / Library project.
  • Add .less file with any valid content.
  • Install Web Compiler extension.
  • Enable compilation of the .less file.
  • Enable compilation on build.
  • Run dotnet restore.
  • Run dotnet build.

See MsBuildTask.zip.

Expected behavior

  • The WebCompiler.CompilerBuildTask task should compile the .less file.

Actual behavior

An exception is thrown:

error MSB4062: The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\dusan\.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 <UsingTask> 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. [H:\~Temp\MsBuildTask\MsBuildTask\MsBuildTask.csproj]

It is not related to this particular MsBuild task. AFAIK every task installed from nuget won’t work from command line. Everything works when running build with VS 2017 RC (15.0.26020.0 D15REL) or msbuild command.

Environment data

.NET Command Line Tools (1.0.0-preview4-004233)

Product Information:
 Version:            1.0.0-preview4-004233
 Commit SHA-1 hash:  8cec61c6f7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15014
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0-preview4-004233

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
ManfredLangecommented, Sep 19, 2017

@ViktorHofer same issue here but using msbuild instead is not an option as it runs into a different set of problems in a solution of 50+ projects targeting either netstandard2.0 or net461.

Some suggestions say use “dotnet build” instead of msbuild, some other sources suggest the opposite. Problem is none of the two works reliably. Running any of them against a solution file doesn’t work at all, so we created our own build tool. It’s a big mess from the perspective of a maintainer of old-ish code (net461, old/new csproj file format) and new code (netstandard2.0). It’s just sad and disappointing, cause a large amount of wasted time.

No need to reopen this issue. Just need to vent somewhere. 😃

1reaction
ViktorHofercommented, Apr 6, 2017

Issue is resolved with newest Xamarin.Forms version! 👍

UPDATE: no it’s not. See below.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run Desktop-Compiled MsBuild tasks installed from ...
Can't run Desktop-Compiled MsBuild tasks installed from NuGet #7600 ... AFAIK every task installed from nuget won't work from command line.
Read more >
Can't run Desktop-Compiled MsBuild tasks installed from ...
Can't run Desktop-Compiled MsBuild tasks installed from NuGet.
Read more >
Nuget not installing in Azure DevOps build
NuGet Task logs version 0.2.31 using NuGet 3.3.0.212 with MsBuild 14.0. I see the nupkg files in the packages folder but the Content...
Read more >
NuGet auto package restore does not work with MSBuild
Run nuget.exe restore which will auto-download all the missing packages. Run msbuild to build your solution. Aside: while the new and ...
Read more >
Issues Running the Local Agent
Hi all, I have installed the local agent on a 2019 Windows Server to ... Use option -MSBuildVersion to force nuget to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found