小编ste*_*nah的帖子

UWP应用程序的堆栈跟踪中的行号

我在Visual Studio 2015中创建了一个空白的Universal Windows App项目。

我添加类似:

try {
    string foo = null;
    int len = foo.Length;
} catch (Exception ex) {
    System.Diagnostics.Debug.WriteLine(ex);
}
Run Code Online (Sandbox Code Playgroud)

我得到如下的堆栈跟踪:

Exception thrown: 'System.NullReferenceException' in TestStackTraces.exe
System.NullReferenceException: Object reference not set to an instance of an object.
at TestStackTraces.App.OnLaunched(LaunchActivatedEventArgs e)
Run Code Online (Sandbox Code Playgroud)

即没有行号。

如何显示行号?

c# visual-studio win-universal-app .net-core

7
推荐指数
1
解决办法
975
查看次数

标签 统计

.net-core ×1

c# ×1

visual-studio ×1

win-universal-app ×1