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

Fix #53181. AssemblyLoadContext incorrectly validates name of dynamiс assembly when returned from Load #53219

Merged

Conversation

Ap0k
Copy link
Contributor

@Ap0k Ap0k commented May 25, 2021

See #53181

@ghost
Copy link

ghost commented May 25, 2021

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

Issue Details

See #53181

Author: Ap0k
Assignees: -
Labels:

area-AssemblyLoader-coreclr

Milestone: -

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

Looks good - thanks a lot!

assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndCollect);
}

AssemblyLoadContext? context = AssemblyLoadContext.GetLoadContext(assemblyBuilder);
Copy link
Member

Choose a reason for hiding this comment

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

Actually - can you also validate that the assembly is in the ALC.Assemblies collection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added check

@Ap0k Ap0k force-pushed the bugfix/GetLoadContextForDynamicAssemblies branch from a8bf6d5 to f9056b8 Compare May 25, 2021 12:00
@vitek-karas
Copy link
Member

The test failure in CI is #48851.

@vitek-karas vitek-karas merged commit f584c74 into dotnet:main May 26, 2021
@vitek-karas
Copy link
Member

@Ap0k thanks a lot for the fix!

@ghost ghost locked as resolved and limited conversation to collaborators Jun 25, 2021
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