【发布时间】:2016-02-07 22:20:27
【问题描述】:
我开发并发布了一个 Windows 通用应用程序。为了跟踪异常和应用程序使用情况,我启用了 Application Insights,我可以通过以下调用堆栈找到 FileNotFoundException:
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee2a4
at Mindapp!<BaseAddress>+0x86bd63
--- End of stack trace from previous location where exception was thrown ---
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee2a4
at Mindapp!<BaseAddress>+0x86d250
--- End of stack trace from previous location where exception was thrown ---
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee2a4
at Mindapp!<BaseAddress>+0x880c5e
--- End of stack trace from previous location where exception was thrown ---
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee2a4
at Mindapp!<BaseAddress>+0x8b3663
--- End of stack trace from previous location where exception was thrown ---
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee2a4
at Mindapp!<BaseAddress>+0x883601
--- End of stack trace from previous location where exception was thrown ---
at Mindapp!<BaseAddress>+0x6e58d1
at Mindapp!<BaseAddress>+0x6ee17e
at Mindapp!<BaseAddress>+0x7d6276
很遗憾,我没有更多信息。是否有技巧可以获取有关此异常的更多详细信息?
【问题讨论】:
-
我一直在使用 AI,充分利用它的关键是确保从一开始就写出好的代码,例如,你的代码应该包含在 try / catch 块中.然后,您可以自己创建一个异常并将其发送给 AI,这样您就可以控制发生的事情、位置、用户信息等,但您也在处理错误。这在我看来就像一个未处理的异常,在编译代码上
-
我的应用程序有点像图表编辑器,我显然无法捕捉到每个操作。这就是为什么有一个全局异常处理程序的原因,不是吗?
-
我会假设,filenotfound 异常,将来自一段与打开文件有关的代码,我的猜测是,这是在函数/方法中。该代码应该被包装,你实际上是在冒泡你的错误,远离创建它的方法,并以废话结束,因为它没有被处理。我的申请是为 XXX 申请的,这不是不处理错误的借口,尤其是当您想对错误进行分析时
-
我添加了自定义异常并改进了文件处理。让我们看看,如果它有帮助。我在某处也有 NullReferenceException。这将很难找到。
-
我相信这是特定于现在构建为 .net 本机的 UAP 应用程序,所以很多有用的信息现在在异常时消失了?
标签: c# win-universal-app azure-application-insights