Eto: [WinForms] GridView scrolling crashes in .Net Core 3.1

Created on 17 Apr 2020  ·  4Comments  ·  Source: picoe/Eto


I couldn't think of a better place to put this, but here's an exact reason for why this is broken in .Net Core 3.1

Expected Behavior

I've just started working on a program in .Net Core 3.1 on Windows (using Forms specifically) and my first Control to add was a GridView + DataTable combo. It works fine up until you attempt to scroll using the mouse (yes the scrollbar works fine from what I've tried)

Actual Behavior

Once you scroll the Grid, the Form will crash and provide this error:

Unhandled exception. System.TypeLoadException: Could not load type 'System.Windows.Forms.DataGrid' from assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at Eto.WinForms.ScrollMessageFilter.IsScrollable(Control control)
   at Eto.WinForms.ScrollMessageFilter.PreFilterMessage(Message& m)
   at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Eto.WinForms.Forms.ApplicationHandler.Run()
   at Eto.Forms.Application.Run(Form mainForm)
   at Your.Program.Main(String[] args) in Your.Program.cs:line here

I provided the reason for this crash in my first sentence, and will switch to a different version of .Net Core just to avoid this until I'm aware this has been solved.

Steps to Reproduce the Problem

  1. Use .Net Core 3.1
  2. Run a form with the GridView example in the Wiki
  3. Scroll your mousewheel/trackpad and experience a crash

Code that Demonstrates the Problem

https://github.com/picoe/Eto/wiki/GridView

Specifications

  • Version: 2.5.0 (Nuget)
  • Platform(s): WinForms
  • Operating System(s): Windwos 10

Thanks for taking a look at my issue :)

All 4 comments

Thanks for reporting the issue. Looks like DataGrid was removed in .NET Core 3.1, along with numerous others. See https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#removed-controls.

We'll need to remove reference to those in Eto.WinForms when building for .NET Core.

Thanks for reporting the issue. Looks like DataGrid was removed in .NET Core 3.1, along with numerous others. See https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#removed-controls.

Yeah I already mentioned that at the top of my issue, glad it's known 👍

Ah, didn't realize you linked to the same page.. 😄 Thanks again, this should be relatively easy to fix, though the question is whether or not to add a netcoreapp31 TFM or just #if it out for 3.0+..

I'm thinking adding a new TFM will expose these issues as compile errors instead of having to deal with them otherwise so that should be better.

Thanks for filing the issue! This should be fixed in the latest CI build and will be included in 2.5.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Krakean picture Krakean  ·  6Comments

Serg-Norseman picture Serg-Norseman  ·  5Comments

LaraSQP picture LaraSQP  ·  21Comments

LaraSQP picture LaraSQP  ·  7Comments

azunyuuuuuuu picture azunyuuuuuuu  ·  23Comments