-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add searched .NET install locations to error message #117796
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
Add searched .NET install locations to error message #117796
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the error messaging when the .NET host cannot find a .NET installation by adding detailed information about which locations were searched during the discovery process.
Key changes:
- Modified
get_dotnet_root_from_env
to clear the environment variable name when no valid path is found - Enhanced error message generation in
fxr_resolver.cpp
to include a comprehensive list of searched locations - Added a new test case to verify the improved error message format
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/native/corehost/hostmisc/utils.cpp |
Modified to clear environment variable name when dotnet root is not found |
src/native/corehost/fxr_resolver.cpp |
Enhanced error message generation with detailed search location information |
src/native/corehost/corehost.cpp |
Removed redundant error logging since detailed error is now handled elsewhere |
src/native/corehost/apphost/standalone/hostfxr_resolver.cpp |
Added error message for non-fully-qualified hostfxr paths |
src/installer/tests/HostActivation.Tests/InstallLocation.cs |
Added test case to verify new error message format |
Comments suppressed due to low confidence (1)
src/native/corehost/fxr_resolver.cpp:162
- [nitpick] The variable name 'searched_locations' could be more descriptive. Consider renaming it to 'search_details_message' or 'location_search_summary' to better indicate it's building an error message.
pal::string_t searched_locations = _X("The following locations were searched:");
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style nit.
… clearing on failure
/ba-g #117811 and timeout in leg unaffected by this change (libraries tests linux_musl) |
Include searched locations in error message when host cannot find a .NET install (
hostfxr
)Example - the 'following locations were searched' section is new:
Resolves #116108
cc @dotnet/appmodel @AaronRobinsonMSFT