在 Visual Studio 上调试 Xamarin Forms 应用程序未处理的异常 [英] Xamarin Forms app unhandled exception debugging on Visual Studio

查看:23
本文介绍了在 Visual Studio 上调试 Xamarin Forms 应用程序未处理的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个一般性问题,我没有发布任何代码,因为问题不在代码中(但您可以下载整个项目,以防您发现它有用:

我习惯于调试 Web 应用程序,在这些应用程序中,未处理的异常相对较少,并且对移动开发来说是新的.自从我开始学习 Xamarin 开发以来,我系统地面临着这种未处理的异常.请注意,我可以调试应用程序并点击断点,但是当我从调试器获得的唯一信息始终是未处理的应用程序"时,这并没有多大帮助.我想我错过了这里的重点,所以任何提示将不胜感激.

解决方案

当您看到此异常窗口时,请单击继续"按钮.Visual Studio 停止调试,您将在输出调试"窗口中看到堆栈跟踪.您可能需要向上滚动一点.搜索未处理的异常.

您也可以在 Visual Studio 中转到帮助 > Xamarin > 打开日志.将打开一个文件夹,您要查找的例外在这些文件中.

This is a general question, I am not posting any code as the problem is not in the code (but you can download the entire project her in case you find it useful: native authentication flow in a Xamarin.Forms application. If I am breaking some community rule please forgive me, if you can help thanks for I could not find an answer elsewhere.

Visual Studio 2015. Xamarin Forms cross platform PCL application. The code builds and runs just fine on both VS android emulator and when deployed on a android 6.0 Samsung 815T device. Same code breaks with unhandled exception when deployed on android 7.0 Samsung SM-A510F device. Again this is NOT the problem but the only hint I get is this:

I am used to debug web application where unhandled exceptions are relatively rare and new to mobile development. Since I started studying Xamarin development I am systematically facing with this kind of unhandled exception. Please note I can debug the application and hit breakpoints but that does not help a lot when the only information I get from the debugger is always "unhandled application". I guess I am missing the big point here so any hint would be appreciated.

解决方案

When you get this exception window, please click the Continue button. Visual Studio stops debugging, you'll see the stack trace in the Output Debug window. You might have to scroll up a little. Search for Unhandled Exception.

And you also could go to Help > Xamarin > Open Logs in Visual Studio. A folder will open and the exceptions you're looking for are in those files.

这篇关于在 Visual Studio 上调试 Xamarin Forms 应用程序未处理的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆