这样打包以后出现错误不会跳到错误的地方
// Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
// AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
//{
// MessageBox.Show("抱歉,您的操作没有能够完成,请再试一次或者联系我们: ");
// LogUnhandledException(e.ExceptionObject);
//}
//static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
//{
// MessageBox.Show("抱歉,您的操作没有能够完成,请再试一次或者联系我们");
// LogUnhandledException(e.Exception);
//}
//static void LogUnhandledException(object exceptionobj)
//{
// //Log the exception here or report it to developer
// MessageBox.Show("错误:" + exceptionobj.ToString() + "。发送错误至:microlchen@qq.com");
//}