Closed xoofx closed 1 year ago
SampleWindowsForms was a bit outdated. I did update sample, but mostly you need just what's in the README.md. Couple questions
net7.0-windows
?Are you using net7.0-windows?
Yep.
is it possible that you have dependency on other library?
I was using directly winforms and the UserControl, so pretty basic.
But don't worry, that was for testing. Probably not gonna use winforms anyway.
I will close it for now. Thanks!
That's pretty strange, since I did try that on different apps, and never seen this issue. Also to let you know that I soon will have update for WinForms + WebView2 + Blazor, so maybe that would be more interesting to you.
Also what OS you are try to compile? I assume that's windows?
Also what OS you are try to compile? I assume that's windows?
Yeah, Windows.
That's pretty strange, since I did try that on different apps, and never seen this issue. Also to let you know that I soon will have update for WinForms + WebView2 + Blazor, so maybe that would be more interesting to you.
My setup is a bit unusual, as it was to test this within a NativeAOT library (and not an exe), though I would not think that would matter, the error is coming from ILC, like it's not even able to locate the assembly, dunno, but weird... anyway, I don't want to bother you with this! 😉
Take a look at this sample https://github.com/kant2002/WinFormsComInterop/tree/main/samples/HostedWindowsForms. I think you was missing --self-contained
when publish application.
Hey,
I was trying to use it on a .NET 7 + NativeAOT and dotnet publish generates the following warning:
And it crashes at runtime indeed.
I had also to remove the initialization of
WinFormsComInterop
(Package0.3.2
) as I saw it hereAny clue?