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

Replace GetCallingAssembly with GetExecutingAssembly #12038

Closed
wants to merge 1 commit into from
Closed

Replace GetCallingAssembly with GetExecutingAssembly #12038

wants to merge 1 commit into from

Conversation

MichalStrehovsky
Copy link

GetCallingAssembly is not supported with .NET 7 PublishAot.

It's not clear why GetCallingAssembly was chosen - GetCallingAssembly returns the assembly of the method that is calling this method. If two different assemblies were to call ResourceUtilities.AssemblyVersion, this code would cache the assembly of the first caller and produce what is essentially an incorrect result for the second caller.

Given the only caller of ResourceUtilities.AssemblyVersion is within the same assembly, it's likely Assembly.GetExecutedAssembly() was intended (it's also indicated by the name of the local variable).

Fixes dotnet/runtime#86202.
Fixes #8549 (that was won't fixed but it's the same problem).

`GetCallingAssembly` is not supported with .NET 7 PublishAot.

It's not clear why `GetCallingAssembly` was chosen - `GetCallingAssembly` returns the assembly of the method that is calling this method. If two different assemblies were to call `ResourceUtilities.AssemblyVersion`, this code would cache the assembly of the first caller and produce what is essentially an incorrect result for the second caller.

Given the only caller of `ResourceUtilities.AssemblyVersion` is within the same assembly, it's likely `Assembly.GetExecutedAssembly()` was intended (it's also indicated by the name of the local variable).

Fixes dotnet/runtime#86202.
Fixes #8549 (that was won't fixed but it's the same problem).
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@MichalStrehovsky
Copy link
Author

Didn't realize I'd have to sign a CLA for a de minimis change. If the CLA is required for de minimis changes, feel free to close because I'm not going to authorize the github app to access my account. Just wanted to help a github user in the linked issue, I don't even know what is Selenium for.

@MichalStrehovsky
Copy link
Author

Looks like this will not be the only issue based on dotnet/runtime#86202 (comment). Someone who cares about this needs to raise an issue in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error when build native aot with selenium dotnet 7 CoreRT AOT Execution Incompatibility
2 participants