How to collect MSBuild binlogs from the command line
Collect a binlog for .NET and .NET Core projects
Build the solution with dotnet build and the -bl option:
dotnet build -bl:C:\logs\msbuild.binlog C:\source\solution\Solution.sln
Collect a binlog for .NET Framework projects
- Find the
MSBuild.exethat comes with Visual Studio:"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exeThe usual locations are
C:\Program Files\Microsoft Visual Studio\18\<Edition>\MSBuild\Current\Bin\for Visual Studio 2026 andC:\Program Files\Microsoft Visual Studio\2022\<Edition>\MSBuild\Current\Bin\for Visual Studio 2022. - Build the solution with the
-bloption:"<path to MSBuild.exe>" -bl:C:\logs\msbuild.binlog C:\source\solution\Solution.sln
Before sharing the binlog
A binlog includes environment variables and the contents of project files. Review it before you share it.
Please sign in to leave a comment.