當我調試我的申請,我得到了很多InvalidOperationException異常和NullReferenceException異常的像這樣:出現InvalidOperationException和NullReferenceException異常
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.InvalidOperationException' occurred in System.Core.dll
A first chance exception of type 'System.NullReferenceException' occurred in XGen.Framework.DLL
它使應用程序的一些慢怎麼辦?
編輯:
發現那裏的出現InvalidOperationException破天
public static Value.Locale Get(string value)
{
try
{ return _Items.First(itm => itm.ID.ToUpper() == value.ToUpper() || itm.Name.ToUpper() == value.ToUpper()); }
catch (Exception)
{ return new XGen.Framework.Value.Locale(); }
}
翻譯文本:該序列不包含任何元素匹配
我應該檢查是否_Items.Count> 0?
您是否已經能夠追查這些異常被拋出的位置? –
幾乎可以肯定。你會想跟蹤這些。 – drdwilcox
nope ...我不知道他們在哪裏發生,但我對應用程序沒有任何問題...我想我會有很多工作在尋找他們... :( – ShadowG