简体   繁体   English

.NET Core 没有任何关于未处理异常的消息

[英].NET Core no message whatsoever on unhandled exception

Trying to migrate app from .NET Framework to .NET (Core) 5.0, my task is made harder by the fact that whenever there's an unhandled exception in the .NET 5 app, I get no error message, no "Application error" event log, no nothing: The app just stops.尝试将应用程序从 .NET Framework 迁移到 .NET (Core) 5.0,我的任务变得更加困难,因为每当 .NET 5 应用程序中出现未处理的异常时,我都没有收到错误消息,也没有“应用程序错误”事件日志,什么都没有:应用程序停止。

This contrasts the .NET Framework 4.8 app I tried on the same machine, which outputs the unhandled exception and adds an "Application Error" entry to the event log.这与我在同一台机器上尝试的 .NET Framework 4.8 应用程序形成鲜明对比,该应用程序输出未处理的异常并将“应用程序错误”条目添加到事件日志中。

Is that normal, or is my .NET 5 installation broken somehow?这是正常的,还是我的 .NET 5 安装以某种方式损坏?

There are Exception Handler Events on ApplicationDomain that you can try;您可以尝试在 ApplicationDomain 上有异常处理程序事件;

Debug with this Events to observe errors, you should define at the beggining of the "Main" method in Program.cs使用此事件进行调试以观察错误,您应该在 Program.cs 中的“Main”方法的开头定义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM