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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With