-
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
Allow using active host context in hostfxr_get_runtime_delegate #86460
Allow using active host context in hostfxr_get_runtime_delegate #86460
Conversation
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsThese changes allow for passing For testing, I decided to add a new test specifically for ensuring that calling Fixes #84143
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I'll leave the final call to @elinor-fung .
src/installer/tests/HostActivation.Tests/NativeHosting/HostContext.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just some minor comments. Thank you for doing this!
I'm going to hazard a guess that the single failure is not really due to my change. I don't see a way of rerunning that one build leg in GH or AzDO (maybe I just don't have permissions). Is there some way to do it without starting an entirely new build? |
Yes - they're unrelated. If you go to Checks and then on the left open Build Analysis, it shows that all the failures are known issues. Thanks a lot for this PR! |
Thanks, @jander-msft! |
These changes allow for passing
nullptr
for the handle parameter of thehostfxr_get_runtime_delegate
function. This allows in-process callers who do not have the real host context handle to invoke this function and get a runtime delegate for the primary runtime instance. Callinghostfxr_get_runtime_delegate
without the handle will only work if there is an active host context, otherwise it will returnStatusCode::HostInvalidState
.For testing, I decided to add a new test specifically for ensuring that calling
hostfxr_get_runtime_delegate
without the handle will work instead of updating the existing tests. Most of the other tests would not have worked with this enablement because it requires an active context handle to be set, which only largely occurs if callinghostfxr_get_runtime_delegate
with an existing handle or callingfx_muxer_t::run_app
; rather than forcing these to unnecessarily invokehostfxr_get_runtime_delegate
twice (one with a handle, the next without), I created a separate test to do just that.Fixes #84143