Open kant2002 opened 4 years ago
Great list, thank you for documenting this!
I experimented a bit with the MenuStrip. Unfortunately, I am not a .NET dev, so I hit an impenetrable wall.
On startup, I get a very weird exception (Maybe there's a separate issue with exception generation of CoreRT):
Unhandled exception at 0x00007FF7F1EF5634 in winforms.exe: 0x892BE4EA. occurred
And the following call stack:
FailFast() Unknown
S_P_CoreLib_System_Runtime_CalliIntrinsicsCall_5
I poked a bit blindly around the source code of WInForms and found this very suspicious code:
Marshal.SizeOf(typeof(SafeNativeMethods.BITMAPINFOHEADER))
I blindly tried some permutations inside rd.xml, similar to the following, but frankly, all this could have been latin incantations from the necronomicon, so I assume I did not do it correctly. I always received the same exception regardles of which assemblies I included in the list.
<Assembly Name="System.Drawing.Common" Dynamic="Required All" />
<Assembly Name="System.Drawing.Primitives" Dynamic="Required All" />
<Assembly Name="System.Windows.Forms" Dynamic="Required All" />
<Assembly Name="mscorlib" Dynamic="Required All" />
I'm leaving this in hope that someone could make sense of the issue.
Marshal.SizeOf(typeof(SafeNativeMethods.BITMAPINFOHEADER))
You can submit PR to WinForms to change BITMAPINFOHEADER
to struct and this line to sizeof(SafeNativeMethods.BITMAPINFOHEADER)
. It has significantly better performance everywhere, and it is guaranteed to be compatible with CoreRT.
Marshal.SizeOf(typeof(SafeNativeMethods.BITMAPINFOHEADER))
You can submit PR to WinForms to change
BITMAPINFOHEADER
to struct and this line tosizeof(SafeNativeMethods.BITMAPINFOHEADER)
. It has significantly better performance everywhere, and it is guaranteed to be compatible with CoreRT.
Even if I do it, how can I verify that this fixes the CoreRT issue? Or, more to the point, if I have built the System.WIndows.Forms and friends assemblies on my machine, how can I reference them from my test CoreRT project?
I'd imagine the instructions in https://github.com/dotnet/winforms/blob/master/Documentation/debugging.md should work
I'd imagine the instructions in https://github.com/dotnet/winforms/blob/master/Documentation/debugging.md should work
I suspect the rabbit hole is quite deep :D Challenge accepted! And thank you for the hint!
Marshal.SizeOf(typeof(SafeNativeMethods.BITMAPINFOHEADER))
The fact that the compiler doesn't figure this one out is actually a dumb regression I caused when I was moving things around. Fixing this to use sizeof
of a struct
is still a very good fix (because it's really just so much faster to use sizeof
), but I'm also submitting #8053 that should resolve this too.
Also, I have submitted the System.Drawing interop improvement as https://github.com/dotnet/runtime/pull/33967
Here the summary of controls working in Windows Forms in my limited testing
Common Controls
Containers
Menu & Toolstrip
I can understand that some issues i due to lack of COM support, but some "crash on selection" looks more like CoreRT issue. Anyway, this issue to give visibility for list of supported out-of-box controls.