Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line numbers in stack traces for UWP apps

I created a blank Universal Windows App project in Visual Studio 2015.

I add something like:

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

I get a stack trace like:

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.e., No line numbers.

How do I get line numbers to show up?

like image 547
steve hannah Avatar asked Mar 16 '16 21:03

steve hannah


1 Answers

This appears to be no longer supported. I am re-posting my answer here, because when I did a search for my answer on another question, it was very difficult to find it in the search results. Hopefully this question will help people find this info easier.

Reference: windows 10 exceptions not including line numbers

Other info:

See corefx #1420 and related corefx #1797.

Also, there is this reference on SO: How to get StackTrace without Exception in Windows Universal 10 App

like image 87
Kory Gill Avatar answered Nov 15 '22 21:11

Kory Gill