I created new project: ASP.NET Core Web Application (.NET Core) and test throw new exception in controller and catch the exception. In exception is no line numbers (exception.ToString()). I added System.Diagnostics.StackTrace to project.json, but line numbers are still missing, even with debugger.
When I change Core framework project to full .NET framework, line numbers are OK. Can I get line numbers of exception in Core framework?
For me, enabling Portable PDB or setting Optimize didn't fix the problem.
But I tried changing the Debugging information to "Full" in Advanced Build Settings and it worked.
Follow the below procedure:
When I enable portable PDBs in Core framework -> line numbers are back :-)
Enable portable PDBs in project.json:
"buildOptions": {
"debugType": "portable",
...
},
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