Skip to content
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

Remove assert in PEFile::GetAssemblyLoadContext #38212

Closed
wants to merge 1 commit into from

Conversation

janvorli
Copy link
Member

The method can return NULL for System.Private.CoreLib during early
runtime initialization stage when the underlying AssemblyLoadContext
doesn't exist yet.

The method can return NULL for System.Private.CoreLib during early
runtime initialization stage when the underlying AssemblyLoadContext
doesn't exist yet.
@janvorli janvorli added this to the 5.0.0 milestone Jun 22, 2020
@janvorli janvorli requested a review from jkotas June 22, 2020 15:19
@janvorli janvorli self-assigned this Jun 22, 2020
@ghost
Copy link

ghost commented Jun 22, 2020

Tagging subscribers to this area: @vitek-karas
Notify danmosemsft if you want to be subscribed.

@janvorli
Copy link
Member Author

cc: @trylek

PTR_AssemblyLoadContext GetAssemblyLoadContext()
{
LIMITED_METHOD_CONTRACT;

_ASSERTE(m_pAssemblyLoadContext != NULL);
Copy link
Member

@jkotas jkotas Jun 22, 2020

Choose a reason for hiding this comment

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

I think this assert is good and it should stay.

Would it be possible to call AppDomain::GetCurrentDomain()->CreateBinderContext() instead of AppDomain::GetCurrentDomain()->GetTPABinderContext() in SetupAssemblyLoadContext; and also delete the null checked for GetAssemblyLoadContext returning NULL from AcquireCompositeImage ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That could work, I'll give it a try.

@janvorli janvorli closed this Jun 22, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants