dennisdoomen / dennisdoomen/CSharpGuidelines

CSharpGuidelinesAnalyzer causes extremely slow builds in .NET 10

Open
#292 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
777
Forks
270
PR merge metrics
No merged PRs in 30d

Description

When building in Visual Studio 2026 with CSharpGuidelinesAnalyzer enabled, I'm observing extremely slow builds. Upon inspection, the analysis takes much longer than usual (several minutes to build a single project). ~This doesn't happen when building from the command line with `dotnet build`.~ I haven't tried in Rider.

Image

Image

I don't think the times in the binlog are actually correct. It definitely did not take anywhere near the reported 44 minutes to complete the build. Interestingly, other analyzers are also reported to be quite slow.

It's still unclear to me why this happens, but I thought to reach out in case others are observing something similar. Please share your experiences so we can better understand what's causing this. I'm posting here for greater visibility.

To measure your own codebase, use the following steps:
- From a command prompt, run:
```
set MSBUILDDEBUGENGINE=1
set MSBUILDDEBUGPATH=c:\binlogs
md c:\binlogs
devenv.exe
```
- Create a `Directory.Build.props` in the root of your codebase with contents:
```xml


true


```
- Open your solution, build the project(s) you want to measure, and close VS
- Open the first file created in c:\binlogs in [MSBuild Structured Log Viewer](https://msbuildlog.com/)
- Navigate to the Analyzer Summary top-level node and expand

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the report with CSharpGuidelinesAnalyzer in Visual Studio 2026, comparing it with dotnet build. Use MSBUILDDEBUGENGINE, MSBUILDDEBUGPATH, ReportAnalyzer, and MSBuild Structured Log Viewer as described, then inspect the Analyzer Summary node. Done means identifying whether the reported analyzer timings are accurate and isolating the cause of the slow build.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.