我在调试时收到未处理的异常,程序停止执行。调试器没有向我显示该行,所以我不知道要修复什么。
An unhandled exception of type '
System.AggregateException
' occurred inmscorlib.dll
Additional information: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
Cannot obtain value of local or argument '
<this>
' as it is not available at this instruction pointer, possibly because it has been optimized away.System.Threading.Tasks.TaskExceptionHolder
我该如何解决这个问题?
我还找到了this question这非常相似。
最佳答案
如消息所述,您有一个任务引发了未处理的异常。
打开 Break on All Exceptions (Debug, Exceptions) 并重新运行程序。
这将向您显示最初抛出异常时的原始异常。
(附加评论):在 VS2015(或更高版本)中。选择 Debug > Options > Debugging > General 并取消选择“Enable Just My Code”选项。
关于c# - 如何修复 "' System.AggregateException' 出现在 mscorlib.dll 中”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11122092/