我正在C#中的visualstudio10中開發項目。 我做了一個表格之後,我試着再添加一個到項目中,但VS無法打開設計器,也沒有爲表格創建正確的文件 它只創建一個名爲「form2.cs」的文件,另一個名爲「 form2.designer.cs「,但它不會打開設計器。相反,它具有以下消息的響應: 並告訴我的調用堆棧按照「創建‘命名空間提供者’中的錯誤」:visual studio表單設計器:創建新表單時出錯
in Microsoft.VisualStudio.CSharp.Services.Language.Interop.IWorld.ConstructNamespace(IntPtr owner, IntPtr baseNodePtr, Boolean noTypeRestrictionInNamespace)
in Microsoft.VisualStudio.CSharp.Services.Language.Interop.WorldExtensions.ConstructNamespaceFromNode(IWorld world, ParseTreeNode context, Boolean noTypeRestriction)
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CFileCodeModel.TryBindType(Compilation compilation, TypeBaseNode typeNode)
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CBasesCollection.IsBaseDefined(Compilation compilation, ParseTreeNode pNode)
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CBasesCollection.Item(Object vtIndex)
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CSlowSnapshot..ctor(CodeElements collection)
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CBasesCollection.CreateSnapshot()
in Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CCollectionBase.GetEnumerator()
in EnvDTE.CodeElements.GetEnumerator()
in Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.CodeTypeDeclarationFromCodeClass(CodeClass vsClass)
in Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnNamespacePopulateTypes(Object sender, EventArgs e)
in System.CodeDom.CodeNamespace.get_Types()
in Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
in Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
in System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
in Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
in Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
in Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
任何幫助會感激...
SRY:我只需在項目屬性中添加默認命名空間,一切正常......
首先想到的是重新啓動Visual Studio ...如果沒有幫助,請嘗試向解決方案添加新的乾淨項目,然後嘗試在該項目中添加表單。 – 2012-04-10 14:03:18
如果你已經解決了這個問題,你應該爲這個問題添加一個答案,並將其標記爲正確的。這樣,其他人可以從你發現的東西中受益。 – DevinB 2012-04-10 14:08:42
我會,只要stackoverflow讓我(7小時......) – n00b 2012-04-10 14:12:20