[dsrouter] improved instructions/log messages#5535
Merged
Conversation
Member
Author
|
Going to keep this in draft until we know the release dates of everything. |
Context: dotnet/android#10351 Context: dotnet/macios#23429 We are adding new MSBuild properties to simplify setting `$DOTNET_DiagnosticPorts` on mobile: * `$(DiagnosticAddress)` * `$(DiagnosticPort)` * `$(DiagnosticSuspend)` * `$(DiagnosticListenMode)` * `$(DiagnosticConfiguration)` if you want to specify the full value yourself, escape `,` with `%2c`, etc. We will ship these properties in future releases of .NET 9 and 10. To improve `dsrouter` the current log message: Start an application on android device with ONE of the following environment variables set: [Default Tracing] DOTNET_DiagnosticPorts=127.0.0.1:9000,nosuspend,connect [Startup Tracing] DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend,connect Will change to: Build and run an Android application such as: [Default Tracing] dotnet build -t:Run -c Release -p:DiagnosticAddress=127.0.0.1 -p:DiagnosticPort=9000 -p:DiagnosticSuspend=false -p:DiagnosticListenMode=connect [Startup Tracing] dotnet build -t:Run -c Release -p:DiagnosticAddress=127.0.0.1 -p:DiagnosticPort=9000 -p:DiagnosticSuspend=true -p:DiagnosticListenMode=connect Note that `dotnet run` *does work*, but it doesn't show good progress on the build & deploy steps as compared to `dotnet build -t:Run` and MSBuild's terminal logger. It can take several seconds to run a `Release` build. I think it's better to recommend `-t:Run` until we improve `dotnet run`.
56b0c2c to
8f85a72
Compare
jonathanpeppers
added a commit
to jonathanpeppers/diagnostics
that referenced
this pull request
Aug 6, 2025
This is WIP, I have a TODO list at the bottom.
This enables you to do:
dotnet-trace collect --dsrouter android -- dotnet build MyApp.csproj -t:Run -c Release -p:DiagnosticSuspend=false
Where `-p:DiagnosticSuspend=false` is optional.
What this does:
* `dotnet-trace` starts
* `dotnet-trace` launches `dotnet-dsrouter` passing the `--` unmatched
args along.
* `dotnet-dsrouter` appends additional MSBuild properties if it
detects the unmatched args are a `dotnet build` or `dotnet run`
commands
* `dotnet-dsrouter` launches the command for the unmatched args.
~~ TODO ~~
- [ ] Merge this one first: dotnet#5535
- [ ] Figure out how we show progress. `dotnet build -t:Run` can take
30 seconds+, so it seems like we somehow need to let the terminal
logger show progress? Not sure how that can work.
- [ ] Switches after the `--` must be quoted in some cases: `'-t:Run'`
for example. This is also a problem with plain `dotnet-trace`. This
could maybe be addressed in a separate PR.
4 tasks
Member
Author
|
@lateralusX @steveisok we released the above MSBuild properties in .NET 10 RC 1 / .NET 9 servicing last week. So, I think we can update the instructions in dsrouter to use these now. |
lateralusX
approved these changes
Sep 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: dotnet/android#10351
Context: dotnet/macios#23429
We are adding new MSBuild properties to simplify setting
$DOTNET_DiagnosticPortson mobile:$(DiagnosticAddress)$(DiagnosticPort)$(DiagnosticSuspend)$(DiagnosticListenMode)$(DiagnosticConfiguration)if you want to specify the full value yourself, escape,with%2c, etc.We will ship these properties in future releases of .NET 9 and 10.
To improve
dsrouterthe current log message:Will change to:
Note that
dotnet rundoes work, but it doesn't show good progress on the build & deploy steps as compared todotnet build -t:Runand MSBuild's terminal logger. It can take several seconds to run aReleasebuild. I think it's better to recommend-t:Rununtil we improvedotnet run.