-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
ComWrappers: are there any (Roslyn) Source Generators planned? #59651
Comments
@obiwanjacobi We are actively investigating options for .NET 7. Using Roslyn source generators is an option, another is to follow the C#/WinRT pattern which also has benefits. As we move further into the .NET 7 planning phase issues will be created and the community consulted on their opinion as well. @jkoritzinsky is going to be investigating options and starting that conversation when appropriate. |
Thanks @AaronRobinsonMSFT - So that will take a year at least..? BTW: I am unfamiliar with C#/WinRT and did not understand its benefits from looking at the code... |
That is a good estimate for an official release. We would likely have Preview releases much earlier though.
That is entirely possible. I think at this point there are two main options.
The benefits are it is a standalone tool that reads an independent source of truth (i.e., |
Thanks @AaronRobinsonMSFT for the pointers. I just spent the better part of the day with SharpGenTools and although it looks very promising, I don't think it can generate the code I am looking for. For instance: I cannot get it to generate real C# interfaces from the C++ COM code. I have tried several mappings, bindings and what not but it's not doing it. Also, I cannot find how to put the generated code somewhere else than buried in the obj folder and how to actually use the generated code... SharpGenTools is my preferred option for that actual source of what I am doing is a 3rd party Cpp Sdk. I imagine just having to run my generator project when a new Sdk version comes out... (would be nice) Using ComWrapper -with or without code gen- seems a lot more work, provided I can massage SharpGenTools a bit more to do what I want... I would be interested to know if the future plans for ComWrapper source gen includes generating from Cpp source code? |
@obiwanjacobi That would likely be a P2 since the C++ is very tricky to make cross-platform successfully and it is substantially more difficult to generate than canonical C#. It is something that is on our list of nice to haves but I am skeptical it would be a P0 or P1. I could see a potential P1 being generation of TLBs, from which C/C++ headers could be generated using Windows tooling though. Keep the questions/comments/requests coming; these types of issues help to drive priorities. |
Proposed plan: #60143 |
Closing this now that the tracking issue is available. See #66674. |
I am dipping my toes into COM interop with the ComWrappers API.
The necessary plumbing code involved in any serious COM interop project is considerable.
My project has almost a 100 interfaces or structs.
So a logical question: (How) can we generate this code and are there any plans to provide this feature?
cc: @AaronRobinsonMSFT
The text was updated successfully, but these errors were encountered: