C
C#4d ago
Elban

csc.exe takes 140 Seconds to build one specific Project

this here is from dotnet build -bl
18> 17 ms CallTarget 3 calls
18> 17 ms CheckForDuplicateItems 3 calls
18> 26 ms GenerateDepsFile 1 calls
18> 34 ms ResolvePackageFileConflicts 1 calls
18> 54 ms MSBuild 4 calls
18> 244 ms ResolveAssemblyReference 1 calls
18> 143783 ms Csc 1 calls
18> 17 ms CallTarget 3 calls
18> 17 ms CheckForDuplicateItems 3 calls
18> 26 ms GenerateDepsFile 1 calls
18> 34 ms ResolvePackageFileConflicts 1 calls
18> 54 ms MSBuild 4 calls
18> 244 ms ResolveAssemblyReference 1 calls
18> 143783 ms Csc 1 calls
the csc took 140ms to build a specific project, while other projects run fine it has no special dependencies and analyzer, it only has LoggerMessage Source Generator How can I debug what takes so long to build?
2 Replies
Elban
ElbanOP3d ago
also in the MSBuild Structed Log Viewer inside the CoreCompile Target ist only the Csc Task that takes long, somehow I'm in a blackbox and can't figure it out seems to be an issue with the CSharpDiagnosticAnalyzerApiUsageAnalyzer see conversation here: https://discord.com/channels/143867839282020352/598678594750775301/1308106236004270110
MODiX
MODiX3d ago
Elban
yea it seems to be like the Microsoft.CodeAnalysis.CSharp.Analyzers, Version=3.3.5.2003 has an issue on my side
Microsoft (R) Visual C# Compiler version 4.12.0-3.24523.10 (16f58fa3)
Copyright (C) Microsoft Corporation. All rights reserved.
NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently.
Total analyzer execution time: 270.200 seconds.
Time (s) % Analyzer
267.852 99 Microsoft.CodeAnalysis.CSharp.Analyzers, Version=3.3.5.2003, Culture=neutral, PublicKeyToken=31bf3856ad364e35
267.817 99 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerApiUsageAnalyzer (RS1022)
0.021 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpImmutableObjectMethodAnalyzer (RS1014)
0.010 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpRegisterActionAnalyzer (RS1002, RS1003, RS1006, RS1012, RS1013)
0.002 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpReportDiagnosticAnalyzer (RS1005)
0.001 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerFieldsAnalyzer (RS1008)
<0.001 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpUpgradeMSBuildWorkspaceAnalyzer (RS1023)
1.077 <1 Microsoft.AspNetCore.App.Analyzers, Version=8.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
...
Microsoft (R) Visual C# Compiler version 4.12.0-3.24523.10 (16f58fa3)
Copyright (C) Microsoft Corporation. All rights reserved.
NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently.
Total analyzer execution time: 270.200 seconds.
Time (s) % Analyzer
267.852 99 Microsoft.CodeAnalysis.CSharp.Analyzers, Version=3.3.5.2003, Culture=neutral, PublicKeyToken=31bf3856ad364e35
267.817 99 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerApiUsageAnalyzer (RS1022)
0.021 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpImmutableObjectMethodAnalyzer (RS1014)
0.010 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpRegisterActionAnalyzer (RS1002, RS1003, RS1006, RS1012, RS1013)
0.002 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpReportDiagnosticAnalyzer (RS1005)
0.001 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerFieldsAnalyzer (RS1008)
<0.001 <1 Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpUpgradeMSBuildWorkspaceAnalyzer (RS1023)
1.077 <1 Microsoft.AspNetCore.App.Analyzers, Version=8.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
...
Quoted by
<@244878754919219200> from #roslyn (click here)
React with ❌ to remove this embed.
Want results from more Discord servers?
Add your server