dotnet / dotnet/sdk

<AnalysisLevel>recommend</AnalysisLevel> fails with meaningless error

Open
#41,431 4 comments 0 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
Using `recommend` as outlined in https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-8#enable-additional-rules causes the build to fail with the error `"[MSBuild]::VersionGreaterThanOrEquals(recommended, 5.0)" cannot be evaluated. Version string was not in a correct format.`

### To Reproduce
1. `dotnet new console`
2. Edit the csproj to add `recommended` to the PropertyGroup.
3. `dotnet build`

image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.