Open Markliniubility opened 7 months ago
Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.
Author: | Markliniubility |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-Host` |
Milestone: | - |
However, to implement this new command, we need to have some information exposed in the corehost,
Can SDK gather most or all of this information in managed code on its own?
For example, it does not make sense for the host to return environment variables. The managed dotnet info
command can read the environment just fine.
However, to implement this new command, we need to have some information exposed in the corehost,
Can SDK gather most or all of this information in managed code on its own?
For example, it does not make sense for the host to return environment variables. The managed
dotnet info
command can read the environment just fine.
Unfortunately, it may be a bit difficult to gather the information within the sdk repo. The current dotnet --info
obtain the information from corehost as well. Ref.
https://github.com/dotnet/runtime/blob/9da53590c9d624b51fddcfb85f76641c78a415d4/src/native/corehost/fxr/command_line.cpp#L283
The corehost will print out the info when there is a command dotnet --info
.
Some earlier discussions for this API proposal: https://github.com/dotnet/sdk/pull/36943
Background and motivation
dotnet SDK intends to implement a new command
dotnet info
to replace the originaldotnet --info
. The detail is specified in https://github.com/dotnet/sdk/issues/33697.However, to implement this new command, we need to have some information exposed in the corehost, which are:
We may make modification to this file to introduce the new API https://github.com/dotnet/runtime/blob/c28bec4d3d63849c9e60dee1e7174b9a180a7e55/src/native/corehost/hostfxr.h#L311-L323
API Proposal
API Usage
Alternative Designs
No response
Risks
it would require some versioning magic but that doable (the host has to work against any SDK, so it would have to know to do the old thing for the old SDK and the new thing for the new SDK and unfortunately this can't be done through an API since the host literally runs the SDK as an app). ---- mentioned by @vitek-karas