首页 > 解决方案 > .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, ContextCallback callback, 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 的移植。

标签: winforms.net-core.net-6.0

解决方案


这是 Core 6.0 P6 中的一个错误(回归)。在 gitub 中打开: dotnet/runtime - 动画 Gif - 除以零 #55972

非常感谢吉米的帮助


推荐阅读