.Net 6 Preview 6 - 进程因未处理的异常而终止 - DivideByZeroException

问题描述

我已经针对 .Net 6 编译了一个可靠/稳定的解决方案,它编译正常,没有错误或警告,我可以操作主窗体的设计器部分,但是当我启动它时,我收到:

   CoreCLR Version: 6.0.21.35212
.NET Version: 6.0.0-preview.6.21352.12
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DivideByZeroException: Attempted to divide by zero.
   at System.Math.DivRem(Int64 a,Int64 b,Int64& result) in System.Private.CoreLib.dll:token 0x600046a+0x0
   at System.Drawing.ImageAnimator.ImageInfo.AdvanceAnimationBy(Int64 milliseconds) in System.Drawing.Common.dll:token 0x6000bed+0x31
   at System.Drawing.ImageAnimator.AnimateImages() in System.Drawing.Common.dll:token 0x60002e0+0x3d
   at System.Threading.Thread.StartHelper.Callback(Object state) in System.Private.CoreLib.dll:token 0x600288d+0x0
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state) in System.Private.CoreLib.dll:token 0x6002a2d+0x40
--- End of stack trace from prevIoUs location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,Object state) in System.Private.CoreLib.dll:token 0x6002a2d+0x80
   at System.Threading.Thread.StartCallback() in System.Private.CoreLib.dll:token 0x600280f+0xe

我在代码中没有任何“划分”,而且我无法调试,因为错误似乎是 dotnet 类的一部分。

你能帮我解决这个问题吗?我只是想预测从 .Net Core 5 到 .Net Core 6 的移植。

解决方法

这是 Core 6.0 P6 中的一个错误(回归)。 在 gitub 中打开: dotnet/runtime - Animated Gif - division by zero #55972

非常感谢jimi的帮助

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...