Fix to run on .NET Core 3.0 #443
Merged
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.
GenerateMethodForDirectCall creates an IL wrapper for a method in the provider. It allows a function OnUnhandledException to be defined in the interface and implemented in the provide. The generated code calls OnUnhandledException if there is an exception. However the methodInfo for the OUE method is from the interface so needs to be called as a virtual method. It looks like .NET Core 3.0 tightens up IL validation and now throws a "Bad IL Format" exception for this, where in .NET Core 2.0 it let it slide.
1-line fix is to CallVirtual instead of Call.
I believe this is a latent bug in our code. We could still raise it with the CoreFx team I guess since it is a change in behavior that could break others (and servicing packagemanagement with this issue could be interesting, since we can't download the new version with a broken version. But we should fix in any case.