I've got some code that stores any errors to our DB and emails us when it happens. Here's the simple call:
The issue is, when we get an email, it's omitting the line number and the filename (somefilename.cs) from the exception, any ideas why?
Here's what the message looks like in our email:
System.NullReferenceException: Object reference not set to an instance of an object.
at SupportCenterSuite.frmMain.FormatGridIssues(Int32 iFocusRowHandle)
And here's what it looks like when I run it in Debug mode and put ex.ToString() in the Watch window:
System.NullReferenceException: Object reference not set to an instance of an object.
at SupportCenterSuite.frmMain.FormatGridIssues(Int32 iFocusRowHandle) in C:\Projects\VS 2010\Windows Apps\SupportCenterSuite\frmMain.cs:line 412
Code:
catch (Exception ex)
{
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
else
Errors.InsertError(ex.ToString());
}
The issue is, when we get an email, it's omitting the line number and the filename (somefilename.cs) from the exception, any ideas why?
Here's what the message looks like in our email:
System.NullReferenceException: Object reference not set to an instance of an object.
at SupportCenterSuite.frmMain.FormatGridIssues(Int32 iFocusRowHandle)
And here's what it looks like when I run it in Debug mode and put ex.ToString() in the Watch window:
System.NullReferenceException: Object reference not set to an instance of an object.
at SupportCenterSuite.frmMain.FormatGridIssues(Int32 iFocusRowHandle) in C:\Projects\VS 2010\Windows Apps\SupportCenterSuite\frmMain.cs:line 412