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

Feature request: Document how to use CsWin32 manually without the source generator #1313

Open
MatejKafka opened this issue Dec 9, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@MatejKafka
Copy link

MatejKafka commented Dec 9, 2024

I'd like to invoke CsWin32 manually in my project (that is, use the nuget package and invoke it from my code, passing it a generated list of functions to generate bindings for and getting back the generated source code). It seems that CsWin32 provides a public API, but it's not publicly documented and there are no examples of how to use it that I could find.

I mostly managed to figure it out by reading through the source code (https://github.com/MatejKafka/powershell-profile/blob/master/CustomModules/PSWin32/PSWin32.psm1), but imo there are other developers who might also be interested in using CsWin32 in this way.

It might not be worth it to write an official documentation given that this is probably a pretty niche scenario, but even publishing a few commented sample programs invoking Microsoft.Windows.CsWin32.Generator to illustrate how to call it would be very useful.

@MatejKafka MatejKafka added the enhancement New feature or request label Dec 9, 2024
@AArnott
Copy link
Member

AArnott commented Jan 15, 2025

It seems that CsWin32 provides a public API, but it's not publicly documented and there are no examples of how to use it that I could find.

The API that CsWin32 allegedly exposes is merely catering to roslyn source generator requirements and allowing our tests to run. Any use of it as a reference assembly in your own application is totally unsupported and may break in the future as we may change any and all APIs that are exposed as public.

That said, the "public" API for at least a few of the classes is likely to be quite stable, and documenting it given enough interest is something to consider.
I hope to create a GitHub Pages doc site for CsWin32 in the future, and this might fit nicely into that.

@AArnott AArnott added the documentation Improvements or additions to documentation label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants