winforms
winforms copied to clipboard
Using source generators for interop
This issue is for tracking usage of source generators for interop.
The Runtime is considering implementing P/Invoke support through source generators: https://github.com/dotnet/runtime/blob/master/docs/design/features/source-generator-pinvokes.md
We should also be exploring is implementing common patterns via source generators. Things like:
- Handling common buffer usage patterns (buffer growth, movement from stack to heap, etc.)
- Generating resource scoping boilerplate (see our various scope types and how we switch between class and struct for tracking proper disposal in debug builds)
Related issues/pulls:
https://github.com/dotnet/runtime/pull/32091
@RussKie Should we close this issue because of #7445?
Yes, thank you for finding this.