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.

Advice about msbuild task warnings

See original GitHub issue

I’m trying to make sense of some of the warnings dotnet-format is spitting out. This is on a solution containing .net core projects, using SDK 3.1.101 on macOS.

When I run dotnet-format on my solution, I get:

Formatting code files in workspace '/Users/ryan/github.com/<path to>.sln.
  Warnings were encountered while loading the workspace. Set the verbosity option to the 'diagnostic' level to log warnings.
  Format complete in 5610ms.

When I rerun with -v diag I get:

Formatting code files in workspace '/Users/ryan/github.com/<pathtosln>.sln'.
  Loading workspace.
  Msbuild failed when processing the file '/Users/ryan/github.com/<projectname>' with message: /usr/local/share/dotnet/sdk/3.1.101/Microsoft.Common.CurrentVersion.targets: (1540, 5): The "Microsoft.Build.Tasks.ResolveNonMSBuildProjectOutput" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.  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.
  Found project reference without a matching metadata reference: /Users/ryan/github.com/dotnet/<projectname>
  Msbuild failed when processing the file '/Users/ryan/github.com/<projectname>' with message: /usr/local/share/dotnet/sdk/3.1.101/Microsoft.Common.CurrentVersion.targets: (1540, 5): The "ResolveNonMSBuildProjectOutput" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "/usr/local/share/dotnet/sdk/3.1.101" directory.
  Found project reference without a matching metadata reference: /Users/ryan/github.com/dotnet/<projectname>
  Found project reference without a matching metadata reference: /Users/ryan/github.com/<projectname>
  Msbuild failed when processing the file '/Users/ryan/github.com/<projectname>' with message: /usr/local/share/dotnet/sdk/3.1.101/Microsoft.Common.CurrentVersion.targets: (1540, 5): The "ResolveNonMSBuildProjectOutput" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "/usr/local/share/dotnet/sdk/3.1.101" directory.
  Found project reference without a matching metadata reference: /Users/ryan/github.com/<projectname>
  Found project reference without a matching metadata reference: /Users/ryan/github.com/<projectname>
  Found project reference without a matching metadata reference: /Users/ryan/github.com/<projectname>
  Complete in 4307ms.
  Determining formattable files.
  Complete in 985ms.
  Running formatters.
  Complete in 518ms.
  Formatted 0 of 106 files.
  Format complete in 5816ms.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:9
  • Comments:24 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
lihuanglxcommented, May 27, 2020

I also encountered the issue:

The "Microsoft.Build.Tasks.ResolveNonMSBuildProjectOutput" task could not be loaded from the assembly Microsoft.Build.Tasks.Core

Upgrading dotnet to 3.1.202 resolved this.

I’m using latest version of both Mac and Ubuntu.

1reaction
rainersigwaldcommented, Mar 10, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning Task - MSBuild
The Warning task allows MSBuild projects to check for the presence of a required configuration or property before proceeding with the next build ......
Read more >
C# Compiler Options to report errors and warnings
The following options control how the compiler reports errors and warnings. The new MSBuild syntax is shown in Bold.
Read more >
In an MSBuild task, how can I access all warnings ...
My overall goal is to read all warnings at the end of a solution build, then log them as errors. This is distinct...
Read more >
MSBuild ignoring parameter to ignore specific warnings
Disable the warning in project properties (in 'Project properties' go to Project properties -> Build > "Errors and warnings" (section), Suppress ...
Read more >
How to graph number of warnings from MSBuild?
I want to add a graph for the number of warnings in my build. I am currently running a MsBuild task that builds...
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