Skip to content

Hostfxr Installation Location Path Key May Diverge from Specification #109974

Closed
@nagilson

Description

@nagilson

Description

sharedhost has Path but InstallLocation does not, and does not exist

My understanding based on this spec is that the registry should contain a path key to the dotnet host. I looked at my registry to see if that was valid. I was able to find a Path key under a location very similar to what the spec stated, but it was in sharedhost, which seems to be inconsistent with the design decision determined in https://github.com/dotnet/designs/blob/main/accepted/2021/install-location-per-architecture.md#:~:text=On%20Windows%20the,arch%3E%5CInstallLocation, where InstallLocation is mentioned as the place in which the install location is stored.

On Windows the multi-arch situation already exists with x86 and x64 architectures. Each installs into a different location and is registered accordingly. The registration mechanism in registry includes the architecture, the key path is HKLM\SOFTWARE\dotnet\Setup\InstalledVersions<arch>\InstallLocation.

On my machine, this is stored in sharedhost, not InstallLocation. My machine is Win 11 and x64.
Image

<RegKeyProductName>sharedhost</RegKeyProductName>

That seems to be what the code does as well. I didn't see any reference to InstallLocation as mentioned in the doc. I also didnt see a new doc describing this sharedhost behavior. Is that expected? Or, Is this design / spec wrong and needs to be updated? Or am I confused and this Path key is for something else, and there never was a place where the path to .NET is marked in the registry?

WoW Node Missing Path Key

There is also information that can be put in the Wow Node. For this information, it doesn't appear to have a Path key? Is that expected?

Image

Registry Inconsistency with --info

Here's another interesting observation. My 9.0.0-preview.7.24405.7 host running dotnet --info says there is an x86 dotnet registered at InstallLocation, but that doesn't exist on my registry. It's got a sharedhost key, though. The registry above shows hostfxr under the InstalledVersions node and some other installation information which is good, but none of those seem to store the path. Is InstalledVersions a placeholder text, then, and substitutable for hostfxr, sharedhost, etc?
Image

cc @elinor-fung @richlander

Reproduction Steps

Install .NET 9 or .NET 8 preview host on various machines and observe regedit behavior can be different. Install the .NET 9 host and see sharedhost is used instead of InstallLocation.

Expected behavior

Should it not be in InstallLocation?

Actual behavior

See above.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-HostdocumentationDocumentation bug or enhancement, does not impact product or test codequestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions