在做的winform窗体的时候使用了LOADING界面,在界面跳转的时候插入LOADING窗体引入他的线程,在本机DEBUG测试的时候没有任何问题,但在服务器上PUBLISH时遇到 Thread was being aborted错误报警,具体报警信息如下See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.Monitor.Enter(Object obj)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at DevComponents.DotNetBar.Office2007RibbonForm.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3620 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
USC_SPC_CLIENT_DEV
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/jiang_huan/Local%20Settings/Apps/2.0/KM7QAJM3.GDA/2CROPRGY.EDE/usc_..tion_529c08ad94ef9191_0001.0000_2fc0e540cdea3e6d/USC_SPC_CLIENT_DEV.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
DevComponents.DotNetBar2
    Assembly Version: 9.2.0.0
    Win32 Version: 9.2.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/jiang_huan/Local%20Settings/Apps/2.0/KM7QAJM3.GDA/2CROPRGY.EDE/usc_..tion_529c08ad94ef9191_0001.0000_2fc0e540cdea3e6d/DevComponents.DotNetBar2.DLL
----------------------------------------
System.Web.Services
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
ssdyuzsb
    Assembly Version: 1.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
rbflcwxv
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.For example:<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.这是本人的LOADING界面的主要代码:public delegate void objDelegate1();        public LoadingFrm()
        {
            InitializeComponent();
        }        private static USC_SPC_CLIENT_DEV.AppFrm.Other.LoadingFrm FrmLoading = new USC_SPC_CLIENT_DEV.AppFrm.Other.LoadingFrm();
        public static void ShowWaitForm()
        {
            FrmLoading.StartPosition = FormStartPosition.CenterScreen;
            FrmLoading.ShowDialog();
        }        public static void CloseWaitForm()
        {
            FrmLoading.Invoke(new objDelegate1(CloseWaitFormImp));
        }        public static void CloseWaitFormImp()
        {
            System.Threading.Thread.Sleep(1000);
            FrmLoading.Close();
        }        public void OnProcessCompleted(object sender, EventArgs e)
        {
            this.Close();
        }
这是我实例化线程时使用的代码
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(AppFrm.Other.LoadingFrm.ShowWaitForm));
                t.Start();
 AppFrm.Other.LoadingFrm.CloseWaitForm();
                    t.Abort();
这个问题我试了很多方法还是没有解决,现在客户都已经催到头皮上了,希望各位大大能帮我看看有什么好的解决方法,我菜鸟一个

解决方案 »

  1.   

     AppFrm.Other.LoadingFrm.CloseWaitForm();//这之前可能你的线程 已经运行完毕,自行销毁了,然后下面在Abort就要出错了,服务器太好了,运行太快了,如果是自行销毁,就取消下面的代码
      t.Abort();
      

  2.   

    已经试过2楼的方法,没有用依旧报错,我都快考虑要不要把loading进程删了算了
      

  3.   

    try
                {
                    System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(AppFrm.Other.LoadingFrm.ShowWaitForm));
                    t.Start();
                    AppFrm.Other.LoadingFrm.CloseWaitForm();
                    t.Abort();
                }
                catch (Exception ExMsg)
                {
                    objFormPkg.ShowMessageBox(ExMsg.Message.ToString());
                }
    我在try catch的时候没有使用1楼提到的命令,出错的时候也应该调用我设好的错误窗口,但现在的问题是这个错误窗口不是在TRYcatch中捕捉到的,而是直接用程序默认的崩溃警告方式返回,用户点CUNTINES还能继续使用,但点quit就直接关闭程序了