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[])}