Skip to content

Add hostfxr_resolve_frameworks_for_runtime_config for resolving runtime frameworks - #101451

Merged
elinor-fung merged 8 commits into
dotnet:mainfrom
elinor-fung:resolveFrameworks-api
May 10, 2024
Merged

Add hostfxr_resolve_frameworks_for_runtime_config for resolving runtime frameworks#101451
elinor-fung merged 8 commits into
dotnet:mainfrom
elinor-fung:resolveFrameworks-api

Conversation

@elinor-fung

@elinor-fung elinor-fung commented Apr 23, 2024

Copy link
Copy Markdown
Member

Implement new hostfxr API per #99027

  • hostfxr_resolve_frameworks_for_runtime_config provides a way to run the host's runtime framework resolution in an isolated manner
    • Return code indicates basic success/failure and the optional callback can be used for additional information about what was or was not resolved
    • For framework-dependent, runs through framework resolution and propagates the result
      • Currently unresolved_count will always either be 0 or 1 - the host stops at the first failed resolution
    • For self-contained, any includedFrameworks per the runtime config are treated as resolved to the app's directory
  • Add tests to NativeHostApis tests and update HostApiInvokerApp test asset to exercise new API
    • Update tests to stop copying hostfxr next to the app - pass in the paths via runtime config and make the test app resolve the load via DllImportResolver

Resolves #99027

cc @dotnet/appmodel @vitek-karas

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@elinor-fung
elinor-fung force-pushed the resolveFrameworks-api branch from d43b845 to a0839bf Compare April 23, 2024 21:19
@elinor-fung
elinor-fung force-pushed the resolveFrameworks-api branch from a0839bf to bfc60ed Compare April 24, 2024 01:36
@elinor-fung
elinor-fung force-pushed the resolveFrameworks-api branch from c0c56c4 to bc0c10c Compare April 30, 2024 16:58
@elinor-fung
elinor-fung marked this pull request as ready for review April 30, 2024 18:49
@elinor-fung elinor-fung added this to the 9.0.0 milestone Apr 30, 2024
Comment thread src/native/corehost/hostfxr.h Outdated
Comment thread src/native/corehost/fxr/fx_resolver.h
Comment thread src/installer/tests/Assets/Projects/HostApiInvokerApp/HostFXR.cs
Comment thread src/installer/tests/Assets/Projects/HostApiInvokerApp/Program.cs Outdated
Comment thread src/native/corehost/fxr/fx_resolver.cpp
Comment thread src/native/corehost/fxr/hostfxr.cpp
Comment thread src/native/corehost/fxr/hostfxr.cpp Outdated
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
@elinor-fung
elinor-fung merged commit c93ee68 into dotnet:main May 10, 2024
@elinor-fung
elinor-fung deleted the resolveFrameworks-api branch May 10, 2024 04:43
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
…time frameworks (dotnet#101451)

- `hostfxr_resolve_frameworks_for_runtime_config` provides a way to run the host's runtime framework resolution in an isolated manner
  - Return code indicates basic success/failure and the optional callback can be used for additional information about what was or was not resolved
  - For framework-dependent, runs through framework resolution and propagates the result
    - Currently `unresolved_count` will always either be 0 or 1 - the host stops at the first failed resolution
  - For self-contained, any `includedFrameworks` per the runtime config are treated as resolved to the app's directory
- Add tests to `NativeHostApis` tests and update `HostApiInvokerApp` test asset to exercise new API
  - Update tests to stop copying hostfxr next to the app - pass in the paths via runtime config and make the test app resolve the load via DllImportResolver
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

2 participants