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.
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:
<Project>
<PropertyGroup>
<ReportAnalyzer>true</ReportAnalyzer>
</PropertyGroup>
</Project>
- 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
- Navigate to the Analyzer Summary top-level node and expand
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 withI haven't tried in Rider.dotnet build.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:
Directory.Build.propsin the root of your codebase with contents: