-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[API Proposal]: Expose dotnet info by introducing a new hostfxr API #98735
Comments
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsBackground and motivationdotnet SDK intends to implement a new command 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 runtime/src/native/corehost/hostfxr.h Lines 311 to 323 in c28bec4
API ProposalSHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_get_dotnet_host_info(
const pal::char_t* dotnet_root,
void* reserved,
hostfxr_get_dotnet_host_info_result_fn result,
void* result_context)
{} API Usage [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)]
internal delegate void hostfxr_get_dotnet_environment_info_result_fn(
IntPtr info,
IntPtr result_context);
[DllImport(Constants.HostFxr, CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
internal static extern int hostfxr_get_dotnet_host_info(
.....); Alternative DesignsNo response Risksit 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
|
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 |
Unfortunately, it may be a bit difficult to gather the information within the sdk repo. The current
The corehost will print out the info when there is a command |
Some earlier discussions for this API proposal: dotnet/sdk#36943 |
Background and motivation
dotnet SDK intends to implement a new command
dotnet info
to replace the originaldotnet --info
. The detail is specified in dotnet/sdk#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
runtime/src/native/corehost/hostfxr.h
Lines 311 to 323 in c28bec4
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
The text was updated successfully, but these errors were encountered: