Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly load events in .NET report AppDomain which isn't very helpful #9348

Closed
rainersigwald opened this issue Oct 19, 2023 · 2 comments · Fixed by #9353
Closed

Assembly load events in .NET report AppDomain which isn't very helpful #9348

rainersigwald opened this issue Oct 19, 2023 · 2 comments · Fixed by #9353
Assignees
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. triaged

Comments

@rainersigwald
Copy link
Member

The log messages all say AppDomain: [Default].

That's accurate but confusing: on .NET there's only ever one AppDomain (because AssemblyLoadContext replaces it).

Given that AppDomains aren't really a thing on .NET, I was wondering if that was log message was instead reporting on which AssemblyLoadContext it was loaded into instead. If it's not, that seems like a nice change to make.

Originally posted by @bording in #9347 (comment)

@rainersigwald rainersigwald added Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. needs-triage Have yet to determine what bucket this goes in. labels Oct 19, 2023
@bording
Copy link
Contributor

bording commented Oct 19, 2023

@rainersigwald If this is something you'd accept a PR for, I'd be up for giving it a go, assuming you can point in me in the general direction of what needs to be changed.

@bording
Copy link
Contributor

bording commented Oct 21, 2023

I had some time to take a look at this, so I've gone ahead and opened a PR: #9353

@AR-May AR-May removed the needs-triage Have yet to determine what bucket this goes in. label Oct 24, 2023
rainersigwald pushed a commit that referenced this issue Oct 26, 2023
When MSBuild was updated to isolate tasks into a custom `AssemblyLoadContext`, `AssemblyLoadsTracker` was not updated to be aware of this change. This means that the log messages always say `AppDomain: [Default]` and don't show any information about which `AssemblyLoadContext` was used to load the assembly.

When `FEATURE_ASSEMBLYLOADCONTEXT` is defined:
- `AssemblyLoadsTracker` now populates `AssemblyLoadBuildEventArgs` with the name of the `AssemblyLoadContext` used to load the assembly . The `appDomainDescriptor` parameter is re-used to do this.
- A new string resource has been added to update the text of `AssemblyLoadBuildEventArgs.Message` to use label the `AppDomainDescriptor` value as "AssemblyLoadContext" instead of "AppDomain".

Fixes #9348.
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants