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

[release/5.0] Fix using .NET COM server with dynamic keyword (port of #48037) #48481

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Feb 18, 2021

Issue: #47329
Fix in master: #48037

Minimal version of the fix from master. Only:

  • Always treat IDispatch::GetTypeInfoCount returning a count of 0 as not supporting type info (even when the returned HRESULT is failure)

Customer Impact

Customers are unable to use .NET COM servers from a .NET client application with dynamic. The only workaround (aside from not using dynamic) is to have the .NET COM server explicitly implement ITypeInfo - build a type library, manually register it, load the type library when the COM object is created, make the class explicitly implement ITypeInfo, forward calls to the type info from the loaded type library, and mark the assembly as imported from a type library. If the client doesn't also own the server being activated, there is no workaround.

Testing

This PR adds automated tests (most of the changes in this PR).

Risk

Low. The change is targeted to only usage of dynamic with COM objects and the fix is simply to relax an unnecessarily strict return code.

Regression

No. Support for dynamic with COM objects was new in 5.0 (but this is a regression from Framework support)

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We will consider for 5.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Feb 19, 2021
@jeffschwMSFT jeffschwMSFT added this to the 5.0.x milestone Feb 19, 2021
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 23, 2021
@jeffschwMSFT jeffschwMSFT modified the milestones: 5.0.x, 5.0.5 Feb 23, 2021
@Anipik Anipik merged commit 09f16de into dotnet:release/5.0 Mar 10, 2021
@elinor-fung elinor-fung deleted the dynamicNetServer-port branch April 8, 2021 17:41
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants