You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: documentation/wiki/Providing-Binary-Logs.md
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,37 @@ However, you should be aware what type of information is captured in the binary
6
6
7
7
⚠ 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.
8
8
9
+
## Capturing Binary Logs for command-line builds
10
+
9
11
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.
### (Preferred way) Capturing logs for all MSBuild invocations
24
+
25
+
### Capturing logs for all MSBuild invocations
26
+
15
27
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:
16
28
17
29
`cmd:`
18
-
```
30
+
31
+
```batch
19
32
> SET MSBUILDDEBUGENGINE=1
20
33
> SET MSBUILDDEBUGPATH=C:\MSBuildReproLogs
21
34
> devenv.exe MySolution.sln
22
35
```
23
36
24
37
`PowerShell:`
25
-
```
38
+
39
+
```powershell
26
40
> $env:MSBUILDDEBUGENGINE = 1
27
41
> $env:MSBUILDDEBUGPATH="C:\MSBuildReproLogs"
28
42
> & "devenv.exe" MySolution.sln
@@ -33,8 +47,10 @@ MSBuild binary logs are then captured to a location specified via `MSBUILDDEBUGP
33
47
⚠ 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)
*[Design time builds logs](https://github.com/dotnet/project-system/blob/main/docs/repo/debugging/design-time-builds.md#gathering-full-fidelity-binlogs)
38
53
39
54
### Capturing specific logs for chosen build invocations
55
+
40
56
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