-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Code Quality: Replace Vanara with CsWin32 #15000
Comments
https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation Another reference explaining the benefits. I think this is an important issue. |
I like this idea. Feel free to work on it with @yaira2’s approval. |
Sounds good, it might be worth splitting this into multiple PRs to make it easier to test and review. |
This comment was marked as outdated.
This comment was marked as outdated.
Just checked about CsWin32, looks promising because of source generator usage like |
Don't know if this is expected behavior when migrating: |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Important
Documented native methods (targets to convert to CsWin32)
Undocumented native functions
|
Description
We're working on utilizing Native Aot in the application, however, runtime marshaler is one of the blocker against this. Vanara uses loads of runtime marshaler via DllImport and ComImport and we're working on replacing it with CsWin32, ultimately removing its reference completely.
Concerned code
Gains
Requirements
Comments
CsWin32 requires you to add interfaces, functions, constants, enums, snd etc in NativeMethods.txt placed in Files.App.CsWin32. #define'd constants also need to be written in that text file and use like "PInvoke.CMF_DEFAULT" (They don't get placed in a particular namespace).
For more info, download ILSpy and win32metadata.winmd in order to see the full projections.
The text was updated successfully, but these errors were encountered: