How to get MSBuild binlogs using command line

1. For .NET & .NET Core projects:

  • Build a problematic solution with dotnet build command using the -bl option (binary log generation).
dotnet build -bl:C:\logs\msbuild.binlog C:\source\solution\Solution.sln

2. For .NET Framework projects:

  • Locate MSBuild.exe used by your Visual Studio. E.g. C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin for Visual Studio 2019 Professional.
  • Build a problematic solution using the -bl option (binary log generation).
MSBuild.exe -bl:C:\logs\msbuild.binlog C:\source\solution\Solution.sln
7 out of 7 found this helpful

Please sign in to leave a comment.

Have more questions?

Submit a request