C# UWP应用程序堆栈跟踪中的行号
我在Visual Studio 2015中创建了一个空白的通用Windows应用程序项目 我添加了如下内容:C# UWP应用程序堆栈跟踪中的行号,c#,visual-studio,win-universal-app,.net-core,C#,Visual Studio,Win Universal App,.net Core,我在Visual Studio 2015中创建了一个空白的通用Windows应用程序项目 我添加了如下内容: try { string foo = null; int len = foo.Length; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); } 我得到的堆栈跟踪如下: Exception thrown: 'System.NullReferenceException' in Tes
try {
string foo = null;
int len = foo.Length;
} catch (Exception ex) {
System.Diagnostics.Debug.WriteLine(ex);
}
我得到的堆栈跟踪如下:
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)
i、 例如,没有行号
如何显示行号?这似乎不再受支持。我在这里重新发布我的答案,因为当我搜索另一个问题的答案时,很难在搜索结果中找到答案。希望这个问题能帮助人们更容易地找到这些信息 参考: 其他资料: 参见和相关的
另外,在SO上有这样一个参考:看看这个答案:@TroelsLarsen,实际上,在WIn10/UWP上,这不再受支持。这是因为UWP中的U。通用意味着您以.NETCore版本的CLR为目标,当前为CoreCLR。它更小,因此更容易移植到不同的平台。两者都会导致缺少功能,因为您没有COM组件可以在运行时从PDB文件中读取行号信息。CLR桌面版本中的Diasymreader.dll。corefx团队中似乎没有人知道这有点可怕。微软已经失去了很多基础知识,营业额很高,也许他们应该问更多这样的问题:)