Skip to content

Commit 1754079

Browse files
Deemphasize MSBUILDDEBUGENGINE in binlog doc
At least one person skimmed over the section we wanted to emphasize (`-bl`) and focused on `MSBUILDDEBUGENGINE`, sharing lower-fidelity logs that are harder to understand. Remove the "Preferred way" callout--it's preferred in that section but not in general. Add a section header for command-line builds. Add some samples there.
1 parent 0dbc421 commit 1754079

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

documentation/wiki/Providing-Binary-Logs.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,37 @@ However, you should be aware what type of information is captured in the binary
66

77
⚠ NOTE: some build environments make secrets available using environment variables. Before sharing a binary log, make sure it does not expose API tokens or other important secrets.
88

9+
## Capturing Binary Logs for command-line builds
10+
911
You can create a binary log by passing the `-bl` parameter to MSBuild (`MSBuild.exe` or `dotnet build`). You can explore the contents of the generated .binlog file using [MSBuild Structured Log Viewer](http://msbuildlog.com/) or in your browser using [Live Structured Log Viewer](https://live.msbuildlog.com). Note: We don't capture any data from binary logs viewed on your browser.
1012

13+
Examples:
14+
15+
```sh
16+
dotnet build -bl
17+
dotnet build -bl:SpecificStep.binlog
18+
MSBuild.exe -bl:ServiceRelease.binlog -p:Configuration=Release
19+
```
20+
1121
[More details about binary logs](Binary-Log.md)
1222

1323
## Capturing Binary Logs Through Visual Studio
14-
### (Preferred way) Capturing logs for all MSBuild invocations
24+
25+
### Capturing logs for all MSBuild invocations
26+
1527
Set `MSBUILDDEBUGENGINE` environment variable to `'1'` and (optionally) set `MSBUILDDEBUGPATH` to an existing destination folder to store the captured logs. Then start Visual Studio from the same shell to inherit the environment:
1628

1729
`cmd:`
18-
```
30+
31+
```batch
1932
> SET MSBUILDDEBUGENGINE=1
2033
> SET MSBUILDDEBUGPATH=C:\MSBuildReproLogs
2134
> devenv.exe MySolution.sln
2235
```
2336

2437
`PowerShell:`
25-
```
38+
39+
```powershell
2640
> $env:MSBUILDDEBUGENGINE = 1
2741
> $env:MSBUILDDEBUGPATH="C:\MSBuildReproLogs"
2842
> & "devenv.exe" MySolution.sln
@@ -33,8 +47,10 @@ MSBuild binary logs are then captured to a location specified via `MSBUILDDEBUGP
3347
⚠ NOTE: logs are being recorded for each MSBuild invocation (including design time builds) and kept in the folder without removing older ones - so the number of log files can grow quickly. It is recommended to set the opt-in environment variable only for the short duration of reproducing the issue to be investigated (though it is understandable that some nondeterministic issues might need multiple reproduction attempts)
3448

3549
Further reading:
50+
3651
* [More technical info](Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md#logs)
3752
* [Design time builds logs](https://github.com/dotnet/project-system/blob/main/docs/repo/debugging/design-time-builds.md#gathering-full-fidelity-binlogs)
3853

3954
### Capturing specific logs for chosen build invocations
55+
4056
See [this guide](https://github.com/dotnet/project-system-tools) in the Project System Tools repo for capturing binlogs through Visual Studio.

0 commit comments

Comments
 (0)