为什么ASP.NET会抛出这么多异常?
巧合的是,我看了一下VisualStudio的调试输出。我可以看到成百上千的各种异常被抛出。我检查了另一个基于ASP.NET的解决方案,它显示了相同的行为。为什么会抛出所有这些异常?我不敢相信这对整体表现有好处,是吗? 请看下面的摘录。它是appr的输出。30秒冲浪。大多数是HttpException,但也有FormatException和ArgumentOutofRangeException。这些都不会真正影响使用。没有崩溃。有人有解释吗,因为这似乎是“正常的”为什么ASP.NET会抛出这么多异常?,asp.net,iis,Asp.net,Iis,巧合的是,我看了一下VisualStudio的调试输出。我可以看到成百上千的各种异常被抛出。我检查了另一个基于ASP.NET的解决方案,它显示了相同的行为。为什么会抛出所有这些异常?我不敢相信这对整体表现有好处,是吗? 请看下面的摘录。它是appr的输出。30秒冲浪。大多数是HttpException,但也有FormatException和ArgumentOutofRangeException。这些都不会真正影响使用。没有崩溃。有人有解释吗,因为这似乎是“正常的” 请查看此URL以了解这些消息的
请查看此URL以了解这些消息的详细信息: 如果愿意,可以通过转到以下位置禁用此输出:
工具-->选项-->调试-->常规-->取消选中将所有输出窗口文本重定向到即时窗口我不确定确切的原因,但我知道如何找到(更好,对吧?:) 在Visual Studio中:
- 点击“调试”菜单
- 点击“例外…”
- 选中“公共语言运行时异常”上的“抛出”
如果实际的异常是:System.Web.StaticFileHandler.GetFileInfo,则显然找不到该文件。如果你没有在浏览器上看到实际的404错误,很可能是因为浏览器在找不到favicon.ico的情况下悄悄地开始工作。如果你重建网站,它能工作吗?不,我是说,一切都能工作。我只是想知道这些例外意味着什么。我看到你接受了答案。我仍然很好奇:这种行为到底是正常的还是你的代码导致的?是的,是我的代码导致的。这是关于所有那些你最终在大型项目中遇到的小麻烦。我可以通过简单地添加空检查而不是try-catch来修复其中的一些问题。其他人正在按预期工作,例如,当尝试使用反射重新连接事件处理程序时。故事的寓意是摆脱那些try/catch块,以便您可以快速找出代码中的错误并加以修复。啊哈。所以这告诉我这不是一个问题,异常会以某种方式得到处理。但它确实表明System.Web.dll和mscorlib.dll内部出现了问题?那么,这种行为正常吗?甚至是超出范围的争论?正在捕获基于异常的控制流的ArgumentOutOfRange气味。。。他们在mscorlib中使用吗?哎哟@Krumelur你确定你自己没有捕捉到这些异常吗?是的,第一次机会异常是被抛出并处理的异常。时间为46秒大概是我拍快照的时间。谢谢!我能找出是什么引起了他们。不幸的是,HtppExceptions已经停止。我去看看他们是否回来。谢谢。现在我知道了:“提供程序与Oracle客户端版本不兼容”。VS2013在我选中“CLRE”之前什么也没做。在VS2015中:单击“调试”菜单、子菜单窗口、项目异常设置(快捷键Ctrl-Alt-E),以获取一组可以检查的异常。
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
'w3wp.exe' (Managed): Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a402e511\e6aaa0de\App_Web_vdj_eurz.dll', Symbols loaded.
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll