Advice about msbuild task warnings
See original GitHub issueI’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:
- Created 4 years ago
- Reactions:9
- Comments:24 (18 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also encountered the issue:
Upgrading dotnet to
3.1.202
resolved this.I’m using latest version of both Mac and Ubuntu.
@jmarolf yeah, add a
new Microsoft.Build.Logging.BinaryLogger()
tohttps://github.com/dotnet/roslyn/blob/441c154b27eafc9ed04feda1786f0f07ce448f14/src/Workspaces/Core/MSBuild/MSBuild/Build/ProjectBuildManager.cs#L171
The examples in our unit tests use a lot of helper methods and aren’t super clear, unfortunately, and the way we hook it up in
msbuild.exe
is also not particularly informative. Holler if you have questions.