Solution for Designer error when opening WorldWind.cs in WW1.4.0
When I load the WW project in my Visual C# 2005 Express Edition , I get the following error when I open WorldWind.cs. I can open the code but the designer refuses to open it.
The designer cannot process the code at line 1070: this.splitContainer.Panel1Collapsed = !World.Settings.BrowserVisible; The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Crea teQuoteexpression_r(XmlElementData xmlElement)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.XmlE lementData.get_CodeDomElement()
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.EndE lement(String prefix, String name, String urn)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars e(XmlReader reader)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars eXml(String xmlStream, CodeStatementCollection statementCollection, String fileName, String methodName)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomParser.OnMethodPopu lateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Stat ements()
at System.ComponentModel.Design.Serializati on.TypeCodeDomSerializer.Deserialize(IDe signerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serializati on.CodeDomDesignerLoader.PerformLoad(IDe signerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Perf ormLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Defe rredLoadHandler.Microsoft.VisualStudio.T extManager.Interop.IVsTextBufferDataEven ts.OnLoadCompleted(Int32 fReload)
Is this a limitation of C# 2005 Express Edition and should I try VS 2005 or an equivalant. Any suggestions ?
The designer cannot process the code at line 1070: this.splitContainer.Panel1Collapsed = !World.Settings.BrowserVisible; The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Crea teQuoteexpression_r(XmlElementData xmlElement)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.XmlE lementData.get_CodeDomElement()
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.EndE lement(String prefix, String name, String urn)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars e(XmlReader reader)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars eXml(String xmlStream, CodeStatementCollection statementCollection, String fileName, String methodName)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomParser.OnMethodPopu lateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Stat ements()
at System.ComponentModel.Design.Serializati on.TypeCodeDomSerializer.Deserialize(IDe signerSerializationManag
at System.ComponentModel.Design.Serializati on.CodeDomDesignerLoader.PerformLoad(IDe signerSerializationManag
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Perf ormLoad(IDesignerSerializationMa
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Defe rredLoadHandler.Microsoft.VisualStudio.T extManager.Interop.IVsTextBufferDataEven ts.OnLoadCompleted(Int32 fReload)
Is this a limitation of C# 2005 Express Edition and should I try VS 2005 or an equivalant. Any suggestions ?
Solution:在WorldWind.cs 文件中加一个函数InitializeWorldWindows();函数体主要由InitializeComponent()中去掉的语句组成,实现加载WorldWindows窗口并显示地球的功能,InitializeWorldWindows()加在构造函数MainApplication()中的InitializeComponent()函数的调用之后;InitializeWorldWindows函数如下:
private void InitializeWorldWindows()
{