You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Versioning issue with ComInterop and async variants #129841
We avoid generating calls to async variants of ComInterop functions. However, there is a versioning issue in the following situation:
A call to an interface function is prejitted
The interface itself gets marked as ComInterop
The interface call is run
In that case we end up with a call to the async variant of a ComInterop function. We currently are not able to generate that. There are a few possible fixes:
Bring back the async thunk
Generate an async version based on the IL from the IL stub emitted for the non-async variant
Move these functions to transient IL plan and have an async version generated that way
Detect the situation and throw away the R2R codegen
I think in cases like that we expect that the VM can detect and throw away outdated R2R. I think in this particular case you can end up crashing the runtime.
Activity
dotnet-policy-service commentedon Jun 25, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
jtschuster commentedon Jun 25, 2026
Wouldn't adding
[ComImport]be considered a non-version-safe API change that should require recompilation?https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules#attributes
jakobbotsch commentedon Jul 9, 2026
I think in cases like that we expect that the VM can detect and throw away outdated R2R. I think in this particular case you can end up crashing the runtime.
jakobbotsch commentedon Aug 27, 2026
Fixed by #131494