Fix SOS layout resolution for single-file tools - #5961
Open
hoyosjs wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 928337e2-55f3-4f09-a49a-cc17f8a1a2a1
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates SOS package asset path resolution to work correctly in true single-file diagnostics tools by anchoring package-relative paths to AppContext.BaseDirectory instead of the consuming assembly’s on-disk location, preventing failures when assemblies have no Assembly.Location.
Changes:
- Root package-relative paths at
AppContext.BaseDirectoryto support single-file apps. - Remove
Assembly.Location-based base directory computation and its failure mode. - Update XML docs to describe the new rooting behavior.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+39
to
+40
| /// The directory containing the application. All package-relative paths are | ||
| /// rooted here. |
noahfalk
reviewed
Aug 13, 2026
| /// <summary> | ||
| /// The directory of the package this type is compiled into. All package-relative | ||
| /// paths are rooted here. | ||
| /// The directory containing the application. All package-relative paths are |
Member
There was a problem hiding this comment.
what does 'application' refer to? When SOS is loaded inside windbg or lldb is it refering to the path where windbg.exe/lldb resides?
| /// rooted here. | ||
| /// </summary> | ||
| private static string s_packageBaseDirectory = ComputePackageBaseDirectory(); | ||
| private static readonly string s_packageBaseDirectory = AppContext.BaseDirectory; |
Member
There was a problem hiding this comment.
Does the SOS host set this directory somewhere? Does this resolve to a path when loaded from an unmanaged host?
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix SOS package asset resolution for true single-file diagnostics tools by rooting package-relative paths at
AppContext.BaseDirectory.This prevents
SOS.InstallHelperfrom failing when its bundled assembly has no on-disk location, while preserving the existing adjacent RID andlibdirectory layout.