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

Marshal.GetActiveObject() for .Net Core 3.1 #37617

Closed
EuroEager2008 opened this issue Jun 8, 2020 · 4 comments
Closed

Marshal.GetActiveObject() for .Net Core 3.1 #37617

EuroEager2008 opened this issue Jun 8, 2020 · 4 comments

Comments

@EuroEager2008
Copy link

Marshal.GetActiveObject() is missing even though COM is supported.
I don't know if other useful (COM related) API's are missing as well.

There should be a way of getting an existing instance of e.g. Excel using .Net Core 3.1.
Are there possibly alternatives?

@scalablecory scalablecory transferred this issue from dotnet/core Jun 8, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Meta untriaged New issue has not been triaged by the area owner labels Jun 8, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Jun 9, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the Future milestone Jun 9, 2020
@AaronRobinsonMSFT
Copy link
Member

Marshal.GetActiveObject() is missing even though COM is supported.

@EuroEager2008 That API was originally removed from .NET Core since COM support was not included. In .NET Core 3.0 we brought back a subset of COM support in order to enable targeted scenarios and aid in porting code from .NET Framework to .NET Core. Exactly what APIs we decided to bring back wasn't really well defined but more a matter of what was the minimum needed to support COM. I believe this is the first ask/request for this particular API.

The Marshal.GetActiveObject() API is a simple wrapper over the Running Object Table (ROT) and relies on specific Win32 APIs that can easily be called via a P/Invoke. An example of how to manually communicate with the ROT can be found at https://github.com/AaronRobinsonMSFT/COMInterop/blob/master/OutOfProcDemo. It is unlikely that we will bring this API back, but please submit a new or update this issue to an api-proposal if you feel this is a must have for your scenario.

@AaronRobinsonMSFT
Copy link
Member

@EuroEager2008 I just realized there is also the Win32 API that can be call via P/Invoke as well: GetActiveObject().

@AaronRobinsonMSFT
Copy link
Member

Given that there is a direct P/Invoke solution to a well-defined Win32 API, I am going to close this. I have verified that the latest .NET Framework implementation was simply doing that as well.

@EuroEager2008
Copy link
Author

Thanks, works fine :)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants