Windows 10通用应用程序(UAP)中的FileNotFoundException
问题描述:
我开发并发布了Windows通用应用程序。为了跟踪异常和应用使用我启用应用见解,我可以找到FileNotFoundException异常的存在与以下调用堆栈:Windows 10通用应用程序(UAP)中的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
不幸的是,我没有更多的信息。有没有一种方法可以获得关于这个异常的更多细节?
答
部署时,UWP应用程序被编译为.net native。为了把上述回有用的东西,你需要像在这里:https://social.msdn.microsoft.com/Forums/en-US/529e6655-bbf2-4ffa-8dcb-b2691327c389/how-to-translate-stack-traces-from-net-native
有遗憾的是不是一个伟大的自动化解决方案,如果你已经是在它的地址的堆栈跟踪。
windbg -z Your.App.dll
然后,您可以发出LM命令来查找DLL的基地址:您可以通过打开您的应用程序的DLL作为一个“场”使用本地Windows调试器手动解码信息调试器和ln命令将每个+偏移位置转换回符号(假设您的PDB方便)。
0:000> lm m My.App
start end module name
00000000`00400000 00000000`00a08000 My.App C (private pdb symbols) My.App.pdb
0:000> ln 0x00400000+0x00021cc4
(00000000`00421cc4) My.App!RHBinder__DllMain
这是一个有点乏味,但它应该完成这项工作。
我一直都在使用AI,所以最关键的是要确保从一开始就编写好的代码,例如,你的代码应该被封装在try/catch块中。然后你可以自己创建一个异常并发送给AI,这样你就可以控制发生了什么,在哪里,用户信息等,但是你也在处理这个错误。这看起来对我来说像一个未处理的异常,编译代码 – davethecoder
我的应用程序就像一个图编辑器,我不明白每一个操作。这就是为什么有全局异常处理程序的原因,不是吗? – SebastianStehle
我会假设,filenotfound异常将来自于一段代码,它说明与打开一个文件有关,我的猜测是,这是一个函数/方法。该代码应该被包装,你基本上冒出了你的错误,远离创建它的方法,并最终废话,因为它没有处理。我的应用程序是为XXX不是没有处理错误的借口,特别是当你想对错误进行分析时 – davethecoder