Eto: [WinForms] .Net Core 3.1 中的 GridView 滚动崩溃

创建于 2020-04-17  ·  4评论  ·  资料来源: picoe/Eto


我想不出一个更好的地方来放置它,但这是在 .Net Core 3.1 中被破坏的确切原因

预期行为

我刚刚开始在 Windows 上的 .Net Core 3.1 中开发一个程序(专门使用 Forms),我要添加的第一个控件是 GridView + DataTable 组合。 在您尝试使用鼠标滚动之前它可以正常工作(是的,滚动条在我尝试过的情况下工作正常)

实际行为

滚动网格后,表单将崩溃并提供此错误:

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

我在第一句话中提供了这次崩溃的原因,并将切换到不同版本的 .Net Core 以避免这种情况,直到我知道这已经解决。

重现问题的步骤

  1. 使用 .Net Core 3.1
  2. 使用 Wiki 中的 GridView 示例运行表单
  3. 滚动鼠标滚轮/触控板并体验崩溃

演示问题的代码

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

规格

  • 版本:2.5.0(Nuget)
  • 平台:WinForms
  • 操作系统:Windwos 10

感谢您查看我的问题:)

所有4条评论

感谢您报告问题。 看起来 DataGrid 已在 .NET Core 3.1 以及许多其他版本中被删除。 请参阅https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#removed -controls。

在为 .NET Core 构建时,我们需要删除对 Eto.WinForms 中的引用。

感谢您报告问题。 看起来 DataGrid 已在 .NET Core 3.1 以及许多其他版本中被删除。 请参阅https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#removed -controls。

是的,我已经在我的问题的顶部提到了,很高兴它是已知的 👍

啊,没有意识到你链接到同一个页面.. 😄 再次感谢,这应该相对容易修复,尽管问题是是否添加 netcoreapp31 TFM 或只是#if it out for 3.0+..

我在想添加一个新的 TFM 会将这些问题暴露为编译错误,而不是必须以其他方式处理它们,这样应该会更好。

感谢您提出问题! 这应该在最新的 CI 版本中修复,并将包含在 2.5.1 中。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

Jojatekok picture Jojatekok  ·  33评论

rothomp3 picture rothomp3  ·  15评论

TomQv picture TomQv  ·  6评论

LaraSQP picture LaraSQP  ·  7评论

azunyuuuuuuu picture azunyuuuuuuu  ·  23评论