.net框架错误日志位置在哪里

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1325829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 13:11:45  来源:igfitidea点击:

Where is the .net framework error log location

.neterror-logging

提问by Graviton

My application exits for no reason, most likely due to errors in the profiler I used because it interferes with all the CLR runtime stuff. The issue is is there any file at any location where .Net framework logs these kind of errors?

我的应用程序无缘无故退出,很可能是由于我使用的分析器中的错误,因为它干扰了所有 CLR 运行时内容。问题是 .Net 框架记录此类错误的任何位置是否有任何文件?

回答by Nader Shirazie

As David says, these errors go to the Application Log in the Windows Event Log.

正如大卫所说,这些错误会进入 Windows 事件日志中的应用程序日志。

If you're looking for a bit more information as your application is terminating, you can subscribe to the UnhandledExceptionevent. That way you will get an exception as your app terminates, and you can inspect the exception in the debugger, or log details to a file of your choosing, etc.

如果您在应用程序终止时需要更多信息,可以订阅该UnhandledException事件。这样,您将在应用程序终止时收到异常,您可以在调试器中检查异常,或将详细信息记录到您选择的文件中,等等。

Note: you cannot "handle" the exception in the traditional sense, your app will die. It does however give you an opportunity to get some useful information on your way out :)

注意:你不能“处理”传统意义上的异常,你的应用程序会死。但是,它确实让您有机会获得一些有关您出路的有用信息:)

回答by David

These errors will often show up in the Windows Event Log (usually in the Application log).

这些错误通常会显示在 Windows 事件日志中(通常在应用程序日志中)。