Remove dependency on Assembly.GetCallingAssembly #25494
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was used to prep expected changes based on a new breaking change caused by the expected behavior of the JIT inlining a target method due to the new support for IL-Emit'd invokers where IL is used to do the invoke and not native\interpreted logic. This caused
Assembly.GetCallingAssembly()
to not return the expected assembly, which caused SDK integration tests to fail.In general, using
GetCallingAssembly()
is not recommended in general since it doesn't work on all platforms\environments and it is fragile essentially requiringNoInlining
attribute.However, there is now a work-around in place in dotnet/runtime#69575 to avoid that breaking change plus plans to remove that work-around in favor of a better approach to using
calli
that does not re-introduce the breaking change.Closing the PR since it is no longer required, although this PR still has merit as mentioned above due to using the fragile
GetCallingAssembly()
; i.e. if the tests were invoked without reflection they would fail today.