I support an application that sends me an email when an error occurs in the application. I drop the stack trace to email and it seems to work fine. The only thing missing is the value of the variables. I get all the calls, etc., just no variables. What am I missing to get these values of variables dumped to email?
Below is the code that I use to send it in an email:
UtilityClass.SendEmail(shortNTID,
"admin@mydomain.com",
new string[] { "support@mydomain.com" },
"MyApplication error has occured for user: " +
shortNTID + " (Main).",
"Message: " + ex.Message.ToString() +
" Source: " + ex.Source.ToString() +
" Target Site: " + ex.TargetSite.ToString() +
" Stack Trace: " + ex.StackTrace.ToString());
And here is the result in the email:
Message: The indicated order is invalid. Source: MyApplication Target Site: Void FindFormAndActivate (MyApplication.MDIParentForm, System.String, System.Object) Stack Trace: in MyApplication.UtilityClass.FindFormAndActivate (MDIParentForm frmMDIParentForm, String formName, Object parameter AttributeMindApp .DashboardAlerts.utAlerts_MouseClick (object sender, MouseEventArgs e) in System.Windows.Forms.Control.OnMouseClick (MouseEventArgs e) in System.Windows.Forms.Control.WmMouseUp (Message & m, MouseButtons button, Int32 clicks) in System.Windows .Forms.Control.WndProc (Message & m) in System.Windows.Forms.Control.ControlNativeWindow.OnMessage (Message & m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message & m) in System.Windows. FormsNativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
, . ? , , , . , , . , a la Application.ThreadException += new ThreadExceptionEventHandler(HandleError);, HandleError - , . , , .