[release/6.0] Override corehost_resolve_component_dependencies
and corehost_set_error_writer
PInvokes in singlefile scenario.
#60111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #60046 to release/6.0
/cc @VSadov
Customer Impact
Re: #59961
Customer reported issue and a regression from 5.0. Missing overrides for 2 functions exported from hostpolicy itself prevent typical plugin scenarios from working in superhost-style singlefile apps.
When we embed exported runtime helpers statically into the singlefile host, the host also adds PInvoke overrides, so that PInvokes would still work and use embedded implementations.
What we missed is that the host component itself (hostpolicy) has 2 exported functions accessible from managed libraries via PInvokes. As a result PInvoking these functions fail in singlefile configuration.
This change adds PInvoke overrides for these two function as well. Also closes a test hole.
Testing
Existing and new unit tests.
Risk
Low.