Replies: 3 comments 9 replies
-
Yes, we expect that AOT works with CsWin32-generated code. In fact WinForms in .NET 8 uses CsWin32 heavily. But for AOT support, your project should include a |
Beta Was this translation helpful? Give feedback.
-
If I create this project (.NET 8+AOT):
With a NativeMethods.txt file like this:
And a Program.cs like this:
Generation and compilation works fine, but at runtime, I get this error:
And I don't see how to fix this since the generated code doesn't use ComWrappers, or am I mistaken? |
Beta Was this translation helpful? Give feedback.
-
Ok thanks, it wasn't obvious looking at available documentation. For reference, I can have it work with this .csproj
NativeMethods.json:
And this code:
One last question: this code has now the requirement of being "fully unsafe", is there any way to make it generate IntPtr/managed interfaces instead of raw pointers? Something like this:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
It's not clear to me what's the status of CsWin32 (in every aspect but I'm mostly interested in generated COM interfaces) vs AOT (I'm talking .NET8 and beyond https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows).
Is it supported (it doesn't seem it is but ...)?
If not, will it ever be? Any timeframe/roadmap?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions