[release/5.0] Remove duplicate entries from dotnet --info #60496
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.
Backport of #60446
Remove duplicate entries from dotnet --info
Remove trailing slashes from globally registered locations as well
Tests not ported due to missing infrastructure
/cc @ericstj
Customer Impact
Customers see duplicate entries in
dotnet --infofor all SDKs and all frameworks when running in the default install on Windows. Regression introduced in RC2. This isn't blocking but it looks pretty bad.Testing
Manually tested end-to-end to verify fix (shown below). Added automated regression test.
Risk
Very low. Leverages existing method in a new place.
Root cause
We are writing a trailing slash on
InstallLocationand the host didn't remove this when considering paths (though it does for other paths). The result is that it considersC:\Program Files\dotnetandC:\Program Files\dotnet\to be separate paths, causing duplicates. Fixing this to avoid the trailing slash in the installer requires a custom action. The reason it worked before was because the installer was using hard-coded strings to write these values. We changed that in ARM64 work to calculate these directories. MSI insists on directories ending in a trailing slash.Result before:
After: