-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
For dotnetup and the installer library, we use hostfxr APIs to list the installed SDKs (and will probably do so for runtimes in the future). Since hostfxr is a native library, it doesn't get packaged in a single-file NativeAOT app. So we need to figure out how to handle this.
Currently, after we install a .NET SDK, we try to load hostfxr.dll from the SDK we just installed. This works for NativeAOT, but might not work if we depend on new APIs in hostfxr that aren't present in an older SDK we are installing.
We could drop the dependency on hostfxr and implement similar functionality in managed code. That would risk behavior differences.
We could also shell out to dotnet --list-sdks or similar commands. This would likely have more overhead.
There is an existing library that implements all three of these strategies which we might be able to take advantage of: https://github.com/ericstj/dotnetlocator
A bit of prior discussion of this can be found here