我在 Visual Studio 2015 中创建了一个新的空白应用程序 (Xamarin.Forms Portable) 项目,并修改了 App.cs 以始终引发异常:
public class App : Application
{
public App()
{
// The root page of your application
MainPage = new ContentPage
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
XAlign = TextAlignment.Center,
Text = "Welcome to Xamarin Forms!"
}
}
}
};
throw new Exception("Exception");
}
当我在适用于 Android 的 Visual Studio 模拟器或物理 Android 设备中调试它时,调试器会因异常而停止,但仅此而已。没有可用的异常详细信息,没有调用堆栈,没有本地变量,什么都没有:
但是,当我在 Windows Phone 模拟器中调试它时,一切正常:
这是正常行为吗?如何获取异常详细信息、调用堆栈、局部变量...等?
有什么想法吗?
我使用的是 Visual Studio 2015 RTM、Windows 8.1 Enterprise 64 位。
最佳答案
这对我有用:
调试 -> Windows -> 异常设置
检查“公共(public)语言运行时异常”。
关于android - Visual Studio 2015 Xamarin.Forms PCL Android 调试 - 空白异常,无调用堆栈,无本地变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31700066/