GitHub - microsoft/CsWin32: A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project. (original) (raw)

C#/Win32 Interop Projection

NuGet badge NuGet badge

C#/Win32 provides P/Invoke and COM Interop projection support for C#. It generates strongly-typed, source-generated bindings from CsWn32-compatible .winmd metadata files. CsWin32 supports the metadata of Microsoft.Windows.SDK.Win32Metadata as the 1st-party metadata.

Getting started

Demo

Animation demonstrating p/invoke code generation