JUST DO IT ~

我只想当个程序员

Invoke 异常无法定位到具体的行要小心

 public void ShowAppendLog(LoggingEvent[] events)
        {
            if (lstInfo.InvokeRequired)
            {
                delegateShowAppendLog dd = new delegateShowAppendLog(ShowAppendLog);
                object[] x = new object[] { events };
                
                    lstInfo.Invoke(dd, x);  ---errror 1
                                   
               
            }
            else
            {


                lstInfo.BeginUpdate();
                try
                 {                 

                     -----  errror2
                    }catch
        
            }
}

---errror 2  真正发生异常的地方
 e
{"未将对象引用设置到对象的实例。"}
    [System.NullReferenceException]: {"未将对象引用设置到对象的实例。"}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "未将对象引用设置到对象的实例。"
    Source: "System.Windows.Forms"
    StackTrace: "   在 System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)\r\n   在 System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)\r\n   在 fundoffer.frmMain.ShowAppendLog(LoggingEvent[] events) 位置 

    TargetSite: {System.Object MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)}
e.InnerException
null
e.InnerException.Message
“e.InnerException”为 null
e.InnerException
null

---errror 1  无法定位到行号
e
{"未将对象引用设置到对象的实例。"}
    [System.NullReferenceException]: {"未将对象引用设置到对象的实例。"}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "未将对象引用设置到对象的实例。"
    Source: "fundoffer"
    StackTrace: "   在 fundoffer.frmMain.ShowAppendLog(LoggingEvent[] events) 位置  form\\frmMain.cs:行号 120"
    TargetSite: {Void ShowAppendLog(log4net.Core.LoggingEvent[])}

posted on 2009-12-29 13:42 小高 阅读(762) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2009年12月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

统计

常用链接

留言簿(3)

随笔分类(352)

收藏夹(19)

关注的blog

手册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜