Skip to content

Conversation

@elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Dec 5, 2025

This package hasn't been the way we construct .NET apps since before 3.0. We currently check for it in the deps.json on startup and write it out as a breadcrumb file for every app - we should be able to stop doing this and avoid some unnecessary file I/O and allocations.

cc @dotnet/appmodel @AaronRobinsonMSFT

Copilot AI review requested due to automatic review settings December 5, 2025 05:06
@dotnet-policy-service
Copy link
Contributor

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

Copilot finished reviewing on behalf of elinor-fung December 5, 2025 05:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes legacy code for tracking and resolving the Microsoft.NETCore.DotNetHostPolicy package, which hasn't been used since before .NET 3.0. The changes eliminate unnecessary file I/O operations (breadcrumb writes and deps.json parsing) and simplify the hostpolicy resolution logic.

Key changes:

  • Simplified breadcrumb setup in hostpolicy_context.cpp by removing explicit policy package tracking
  • Removed deps.json parsing logic that searched for hostpolicy version information
  • Streamlined hostpolicy_resolver::try_get_dir() signature by removing unused probe_paths parameter
  • Removed obsolete package-related macros from configure.h.in

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/native/corehost/hostpolicy/hostpolicy_context.cpp Simplified breadcrumb initialization by removing hardcoded hostpolicy package insertion and consolidating resolver call
src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp Removed legacy functions for parsing deps.json, probing package directories, and servicing lookups; simplified try_get_dir() to only check expected locations
src/native/corehost/fxr/hostpolicy_resolver.h Updated try_get_dir() signature to remove probe_realpaths parameter
src/native/corehost/fxr/fx_muxer.cpp Updated all try_get_dir() call sites to match new signature
src/native/corehost/configure.h.in Removed HOST_POLICY_PKG_NAME and HOST_POLICY_PKG_REL_DIR macro definitions
src/native/corehost/apphost/static/hostpolicy_resolver.cpp Updated try_get_dir() signature to match header
src/installer/tests/TestUtils/DotNetBuilder.cs Removed test code that created mock DotNetHostPolicy package structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants