這是我繼承了一個應用程序的代碼段,用戶拿到死亡黃屏:未設置爲一個對象對實例化對象的NullReferenceException?
的一個實例就行
對象引用:
bool l_Success ...
現在我95%肯定有故障的說法是
ref l_Monitor
這是非常奇怪的考慮對象實例化前幾行。任何人都有線索爲什麼會發生?請注意,我看到在代碼的其他地方彈出相同的問題。IDMS.Monitor l_Monitor = new IDMS.Monitor(); l_Monitor.LogFile.Product_ID = "SE_WEB_APP"; if (m_PermType_RadioButtonList.SelectedIndex == -1) { l_Monitor.LogFile.Log( Nortel.IS.IDMS.LogFile.MessageTypes.ERROR, "No permission type selected" ); return; } bool l_Success = SE.UI.Utilities.GetPermissionList( ref l_Monitor, ref m_CPermissions_ListBox, (int)this.ViewState["m_Account_Share_ID"], (m_PermFolders_DropDownList.Enabled) ? m_PermFolders_DropDownList.SelectedItem.Value : "-1", (SE.Types.PermissionType)m_PermType_RadioButtonList.SelectedIndex, (SE.Types.PermissionResource)m_PermResource_RadioButtonList.SelectedIndex);
另請參見[.NET中的NullReferenceException是什麼?](http://stackoverflow.com/q/4660142/90527) – outis 2012-03-29 01:13:43