Skip to content

Conversation

@steveharter
Copy link
Contributor

@steveharter steveharter commented May 18, 2022

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 requiring NoInlining 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.

public readonly string DefaultTfm;

protected AspNetSdkTest(ITestOutputHelper log) : base(log)
protected AspNetSdkTest(ITestOutputHelper log, Assembly testAssembly) : base(log)
Copy link
Member

Choose a reason for hiding this comment

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

Can we use GetType() here instead? We do that in some other types in the framework like MemoryStream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this class is not concrete, GetType() wouldn't work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants