How can you trackle the line of error in an application which is already deployed in server and you don't have the access of the application?
How to find line of error without touching code?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Pankajkumar PatelRank #181 · 13.4K reputationPosted Nov 8, 2022, 1:06 AM EST
Hi Brahma Prakash Shukla,
StackTrace class can be used to get the line number for more than just the formatted stack trace you get from Exception.StackTrace as like following:
try { throw new Exception(); } catch (Exception ex) { // Get stack trace for the exception with source file information var st = new StackTrace(ex, true); // Get the top stack frame var frame = st.GetFrame(0); // Get the line number from the stack frame var line = frame.GetFileLineNumber(); }This can only work if there is a pdb file available for the assembly.
For more details:
https://stackoverflow.com/questions/3328990/how-can-i-get-the-line-number-which-threw-exception
Hope, this will help you!
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 31, 2022, 3:08 AM EDT
Hi,
If your application have proper error handling then you can find from your log. i.e. DB error loged or kibana, elmah etc.
Naresh BeniwalRank #365 · 6.8K reputationPosted Nov 7, 2022, 3:59 PM EST
https://stackoverflow.com/questions/3328990/how-can-i-get-the-line-number-which-threw-exception