我有一個基於WinForms的應用程序。它的編譯和運行非常完美。 問題是,從昨天開始,我無法打開主窗體的設計器文件。
起初我以爲這是由於我添加以下電話:設計器在VS 2008上加載c#/ .Net 3.5的錯誤
StyleManager.Load("some isl file");
我刪除它,我解開了更改文件,並沒有什麼。
我得到的錯誤是來自XmlDocument.LoadXml()
調用的「根元素丟失」。源是實際嘗試加載xml文件的方法,但只在運行時才這樣做。
如果我忽略此消息,我會得到一個「對象引用未設置爲對象的實例」的錯誤,並且通過忽略這一點,我會得到「設計器已經加載」。
更新
如果我註釋掉的應該讀取XML(在InitializeComponent()
)方法的代表登記,不發生問題。
我們在我們的解決方案中使用Infragistics,並在堆棧跟蹤中提及它們。
在System.Xml.XmlTextReaderImpl.Throw(例外五) 在System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(字符串RES) 在System.Xml.XmlTextReaderImpl.ParseDocumentContent() 在System.Xml.XmlTextReaderImpl。閱讀() 在System.Xml.XmlLoader.Load(DOC的XmlDocument,XmlReader中的讀者,布爾preserveWhitespace) 在System.Xml.XmlDocument.Load(XmlReader中讀取) 在System.Xml.XmlDocument.LoadXml(字符串XML) 在MyApp.Utilities.Xml.Load(String str) at Editor.Editor.tabFlowView_ActiveTabChanged(Object sender,ActiveTabChangedEventArgs e) at Inf ragistics.Win.UltraWinTabControl.UltraTabControlBase.OnActiveTabChanged(ActiveTabChangedEventArgs E) 在Infragistics.Win.UltraWinTabControl.UltraTabControlBase.RaiseEvent(UltraTabControlEventId ID,EventArgs的) 在Infragistics.Win.UltraWinTabControl.UltraTabControlBase.set_ActiveTab(UltraTab值) 在Infragistics的。 Win.UltraWinTabControl.UltraTabControlBase.OnManagerSelectedTabItemChanging(對象發件人,SelectedTabItemChangingEventArgs E) 在Infragistics.Win.UltraWinTabs.TabManager.set_SelectedTabItem(ITabItem值) 在Infragistics.Win.UltraWinTabControl.UltraTabControlBase.SetSelectedTab(UltraTab標籤) 在Infragistics.Win。 Infragistics.Win.UltraWinTabControl.UltraTabControlBase上的UltraWinTabControl.UltraTabControlBase.PerformAction(UltraTabControlAction actionCode) .PerformDelayedInitialize() 在Infragistics.Win.UltraWinTabControl.UltraTabControlBase.OnCreateControl() 在System.Windows.Forms.Control.CreateControl(布爾fIgnoreVisible) 在System.Windows.Forms.Control.CreateControl(布爾fIgnoreVisible) 在系統.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms。 Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control。ControlCollection.Add(控制值) 在System.Windows.Forms.Form.ControlCollection.Add(控制值) 在System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(對照C)
我把它調用XML有關裝載的是你自己設計的呢? – 2011-02-16 09:42:39