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

Prefer GAC_64 over GAC_32 #240

Closed
JPaja opened this issue Dec 28, 2021 · 1 comment · Fixed by #242
Closed

Prefer GAC_64 over GAC_32 #240

JPaja opened this issue Dec 28, 2021 · 1 comment · Fixed by #242
Labels
bug dotnet Issues related to AsmResolver.DotNet
Milestone

Comments

@JPaja
Copy link
Contributor

JPaja commented Dec 28, 2021

Describe the bug

32 bit libraries sometimes don't have same mdtokeens as their 64 bit counterparts. If we store tokens of gac members inside assembly, when executed they might resolve wrong member since runtime will use 64 bit version of library.

Solution

GAC_64 libraries should be preferred over 32 bit.
GAC_32 should only be used when module.IsBit32Required || module.IsBit32Preferred

@JPaja JPaja added the bug label Dec 28, 2021
@Washi1337 Washi1337 added the dotnet Issues related to AsmResolver.DotNet label Dec 29, 2021
@Washi1337 Washi1337 added this to the 4.8.0 milestone Dec 29, 2021
@Washi1337
Copy link
Owner

Side note: Even though this is indeed incorrect behavior of the assembly resolver, it is questionable whether you should ever rely on metadata tokens of definitions from another assembly. They are subject to change, especially modules that reside in the GAC and get updated after a Windows update.

@Washi1337 Washi1337 linked a pull request Dec 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dotnet Issues related to AsmResolver.DotNet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants