Blazor Activity links on global render vs per-page rendermode are totally different
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
On project with per-page rendermode, the traces are pretty useless.
`Microsoft.AspNetCore.Components.Navigate` adds links to the route and then stores it in the link store. https://github.com/dotnet/aspnetcore/blob/27fe84d1b17e218c66b53351799687aec7a7598d/src/Components/Components/src/ComponentsActivitySource.cs#L47
However, when an event handler is run, that is in circuit context, which has a DIFFERENT `_componentsActivityLinkStore` and thus the links it was supposed to add does not exist.
### Expected Behavior
On ``
and link to page activity in the event activity:
### Steps To Reproduce
1. make new blank blazor with aspire and global rendermode.
2. Start project
3. Click Counter link
4. Click Increment a few times
5. Find trace in aspire -> CORRECT
6. convert app to per-page (or just create another with per-page rendermode)
a. remove global rendermode
b. add rendermode to home and counter page
7. do 2-5 again -> INCORRECT
### Exceptions (if any)
On page level `@rendermode`
### .NET Version
10.0.100
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.