.NET Framework - Can't load form in Design mode: Projectitem unavailable

Asked By Dan Cooperstock on 06-Mar-07 09:49 AM
All of a sudden, I can't load one of my forms in design mode. I've been
working on making it Localizable, but haven't done any direct editing of
the resource files or the formname.designer.cs file.

What I'm seeing in VS.NET 2005 is an error window saying:

----------------------------------------------------
One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

Projectitem unavailable.

at EnvDTE.ProjectItem.get_FileCount()
at
Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.GetF
ileNameForProjectItem(ProjectItem item)
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.BuildType
()
at
Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.GetObjectTyp
e()
at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode()
at
Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GlobalKey.GetHash
Code()
at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value,
Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.TrackGlobal
(GlobalObjectProvider p, GlobalType g)
at
Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects
(Type baseType)
at
Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects
()
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResoluti
onService.GetTypeFromGlobalObjects(String name, Boolean throwOnError,
Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResoluti
onService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResoluti
onService.GetType(String name, Boolean throwOnError)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType
(ITypeResolutionService trs, String name, Dictionary`2 names)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStat
ementTable(IDesignerSerializationManager manager, IDictionary table,
Dictionary`2 names, CodeStatementCollection statements, String className)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserial
ize(IDesignerSerializationManager manager, CodeTypeDeclaration
declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformL
oad(IDesignerSerializationManager manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoad
er.PerformLoad(IDesignerSerializationManager serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad
(IDesignerLoaderHost host)
-------------------------------------

Help! How do I fix this?

---------------------------
Dan Cooperstock
DONATION web site: http://www.FreeDonationSoftware.org
DONATION Support forums: http://forums.FreeDonationSoftware.org
E-mail: mailto:info@FreeDonationSoftware.org
Home Phone: 416-423-9064




Dan Cooperstock replied on 06-Mar-07 10:09 AM
Dan Cooperstock <dancoo@newsgroups.nospam> wrote in


NEVER MIND! I just exited VS.NET and restarted it, and the problem went
away. Argh!

However, if anyone has any insight about this, I'd still be interested.

---------------------------
Dan Cooperstock
DONATION web site: http://www.FreeDonationSoftware.org
DONATION Support forums: http://forums.FreeDonationSoftware.org
E-mail: mailto:info@FreeDonationSoftware.org
Home Phone: 416-423-9064