dotnet / dotnet/roslyn

Inconsistent Analyzer-Reporting behaviour local vs Build Server

Open
#82,850 2 comments 1 reaction 0 assignees View on GitHub
Area-Analyzers
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
we have custom analyzers. One reports classes that should be named according to modifiers (ie "abstract" -> "...Base").
This Analyzer gets triggerd on our build server (Devops on premise, MSBuild@1, msbuild location from VS 2026). However it does not get triggerd locally in Visual Studio, no matter how many (re)builds and "Run Code Analysis on Solution" is done.

### To Reproduce
- Symbol Analyzer
- context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
- partial class
- Entity.cs with no modifiers
- generated part with "partial" keyword inside of a "Entity.Designer.cs" file

### Exceptions (if any)

### Further technical details
details of dotnet --info


.NET SDK:
Version: 10.0.200
Commit: 40cd698e5c
Workload version: 10.0.200-manifests.b2769242
MSBuild version: 18.3.0-release-26119-122+40cd698e5

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.200\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.4
Architecture: x64
Commit: 80d3e14f5e

.NET SDKs installed:
7.0.102 [C:\Program Files\dotnet\sdk]
8.0.419 [C:\Program Files\dotnet\sdk]
9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk]
9.0.205 [C:\Program Files\dotnet\sdk]
10.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [true]

global.json file:
Not found

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

Download .NET:
https://aka.ms/dotnet/download

- VisualStudio 2026: Insiders [11605.296]

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Symbol Analyzer with context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None) against the partial Entity.cs and Entity.Designer.cs example. Compare reporting from Visual Studio 2026, "Run Code Analysis on Solution," rebuilds, and the DevOps MSBuild@1 build using the supplied .NET details. Done means the local-versus-build-server behavior is explained and the expected analyzer reporting is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.