sdk icon indicating copy to clipboard operation
sdk copied to clipboard

MSBuild 17.9.4 no longer reports code style errors in build

Open metoule opened this issue 11 months ago • 3 comments

Describe the bug

With .NET SDK 8.0.101, a project using <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> correctly reports IDE0036 (for example), while .NET SDK 8.0.200 no longer reports the error.

With MSBuild 17.8.3:

image

With MSBuild 17.9.4:

image

To Reproduce

Github repo: https://github.com/metoule/msbuild-17.9.4-editorconfig

Exceptions (if any)

Further technical details

dotnet --info

.NET SDK:
 Version:           8.0.200
 Commit:            438cab6a9d
 Workload version:  8.0.200-manifests.cdf2cc8e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.200/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2

.NET SDKs installed:
  8.0.200 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
  • IDE: dotnet build

metoule avatar Mar 01 '24 16:03 metoule

It's similar, except that my repro fails even if there's no mix between severity settings from dotnet_diagnostic.IDExxxx.severity and option_name = option_value:severity, as suggested by https://github.com/dotnet/roslyn/issues/52991#issuecomment-1960692440, contrary to the other issue's repro project.

metoule avatar Mar 07 '24 08:03 metoule

@mavasani FYI Is this also fixed by https://github.com/dotnet/roslyn/pull/72238 and https://github.com/dotnet/sdk/pull/38968 ?

cremor avatar Mar 07 '24 08:03 cremor

@mavasani This is caused by GetEffectiveCustomTags only being applied in DiagnosticHelper.Create, when diagnostics like IDE0073 or IDE0036 use Diagnostic.Create directly.

js6pak avatar Mar 07 '24 21:03 js6pak