Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form visible at runtime, but not at design time

My project has no errors, I'm able to run it via F5, but I can't look at my "main" form, as the [Design] tab tells me, "To prevent possible data loss before loading the designer, the following errors must be resolved: The class name "?" is not a valid identifier for this language."

But the Error List that contains that Description says it's at Line 0 and Column 0.

Build | Clean Solution did not help.

The Call Stack from the [Design] page is:

at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.CodeTypeDeclarationFromCodeClass(CodeClass vsClass)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnNamespacePopulateTypes(Object sender, EventArgs e)
at System.CodeDom.CodeNamespace.get_Types()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

UPDATE

A shutdown of VS2010 and restart solved it.

Here: http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(WHYDTELPAGE)%3bk(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&rd=true

I found a few suggestions, including this one (but I didn't need to try it, as making VS go to its room for a minute or two before coming back out worked):

"delete the [solutionname].suo file which contains designer layout info from your previous session, then start the project and rebuild.."

like image 412
B. Clay Shannon-B. Crow Raven Avatar asked Jul 06 '12 17:07

B. Clay Shannon-B. Crow Raven


2 Answers

I remember I saw this before. According to this it might be a compilation issue (too many brackets) which happens in VS2008 and won't surprise me if it happens in VS2010 too.

like image 84
GETah Avatar answered Sep 23 '22 06:09

GETah


Just Close the project and re-open.

Problem resolved My project

like image 23
Vijay M Avatar answered Sep 22 '22 06:09

Vijay M