为什么VS2015在调试模式下使用Step

为什么VS2015在调试模式下使用Step

本文介绍了为什么VS2015在调试模式下使用Step Over(F10)时跳过线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用Visual Studio Emulator for Android时,当我尝试从一行到另一行时,会跳过一些行。

When using Visual Studio Emulator for Android some lines are skipped when I try to go from line to line.

AppDomain.CurrentDomain.UnhandledException += ApplicationUnhandledExceptionHandler;
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;

上述行在仿真器上跳过,但不在设备上。我正在检查这个,因为在模拟器上没有调用处理程序。我试图直接设置断点,没有成功。

The above lines are skipped on emulator, but not on device. I'm inspecting this, because a handler is not called on emulator. I tried to set the breakpoint directly without success.

在调试模式下跳过线路的原因是什么?

What is the reason for line skipping in debug mode?

推荐答案

有时候Android部署变得困惑 - 断点无法触发(通常在编辑器界面中显示为空白的圆圈,表示源不匹配),该应用不能按照您的期望运行,等等。

Sometimes Android deployment gets confused - breakpoints fail to trigger (they usually show as open circles in the editor gutter, which indicates source mismatch), the app doesn't run the way you expect, etc.

当IDE显示不同意您的设备或模拟器正在执行的代码时,我发现强制卸载该软件包,然后从IDE重新部署通常解决它。通过使用ADB命令提示符并运行adb uninstall com.company.packagename可以最可靠地完成此操作。之后,只需像以前一样从IDE重新构建和运行应用程序。

When the IDE shows code that disagrees with what your device or simulator is doing, then I have found that forcing an uninstall of the package and then redeploying from the IDE usually resolves it. This can be done most reliably by using the ADB command prompt and running "adb uninstall com.company.packagename". After that, just rebuild and deploy/run the app again from the IDE as you normally would.

这篇关于为什么VS2015在调试模式下使用Step Over(F10)时跳过线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:30