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

Proposal for System.Runtime.CompilerServices.ICastable .NET Core public API #23727

Closed
shrah opened this issue Oct 3, 2017 · 6 comments
Closed
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-Interop-coreclr
Milestone

Comments

@shrah
Copy link
Contributor

shrah commented Oct 3, 2017

We need the System.Runtime.CompilerServices.ICastable for building the CoreCLR version of System.Private.Interop.

Current Workarounds:

Today we use a hack by publishing the System.Private.ICastable.dll though myget and consume it from CoreRT.

Discussion:

The ideal solution would be to expose it as a public .NET Core API possibly in System.Runtime.InteropServices.dll

@karelz
Copy link
Member

karelz commented Oct 5, 2017

@shrah can you provide more info what is the interface for, how is it used, etc.? See example in API review process

@morganbr
Copy link
Contributor

morganbr commented Oct 6, 2017

What's the value of ICastable to developers outside of interop? As I understand it right now, it's very dangerous and fragile and only fulfills a very specific purpose. If you just have layering problems for System.Private.Interop, we can probably work out something more scoped than making ICastable public.

@shrah
Copy link
Contributor Author

shrah commented Oct 9, 2017

ICastable is an interface used by the runtime to support dynamic interface casting. Implementing this interface on a type will allow the type to support interfaces (for the purposes of casting and interface dispatch) that do not appear in its interface map.

An example of ICastable is here __ComObject .

@morganbr that is a good question. I don't have any other use cases for ICastable outside of interop right now.

@jkotas , can you think of any other use cases of ICastable outside of interop?

@jkotas
Copy link
Member

jkotas commented Oct 10, 2017

we can probably work out something more scoped than making ICastable public.

  • Compatibility: We want to be able to maintain same level of compatibility for this API as for any other public API.
  • Documentation: It is ok to document this API for use by tools.

can you think of any other use cases of ICastable outside of interop?

Yes, this is primarily to support interop.

@jkotas
Copy link
Member

jkotas commented Oct 10, 2017

For ProjectN, we have invented CastableObject that fixed some of the issues with ICastable. Would we want to expose the CastableObject instead?

https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastableObject.cs

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@stephentoub stephentoub modified the milestones: 5.0, Future Feb 15, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Feb 24, 2020
@AaronRobinsonMSFT
Copy link
Member

Closing this issue in lieu of #36654

@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-Interop-coreclr
Projects
None yet
Development

No branches or pull requests

9 participants