Visual Studio 2010: Add New Item to Project Issue

by Aaron 23. January 2011 04:56

A couple of weeks ago, we got an email from one of the developers on our project who happened to be working off-site for the day.  It said:

Are any of you able to add a class to Fake.Project.Name?  The dialog
has no installed templates listed when I try.

Of course I thought it was user error until I tried it myself.  This is what I saw:

Add new item - empty template list

Notice that it's an empty list.  I tried another project and got a dialog that actually had what I was looking for:

Add new item - correct list

I did some work with Great Migrations, so I learned a bit about what makes up a project file to tell Visual Studio what is the project type, the language, etc.  It's all very Microsoft-oriented GUID-oriented, much like SharePoint and TFS.  So I suspected that the project file had gotten corrupted somehow with a bad GUID or a GUID that was removed.

The odd thing is that the projects were originally created in Visual Studio 2008 using C# for .NET 3.5.  They were upgraded for Visual Studio 2010 using the upgrade wizard.  Nothing about the project was hand-edited.  Regardless, I did a comparison of the project files to see what the differences were, paying close attention to anything that defines the type of project and language.  This is the first thing that caught my eye:

It's a minor thing, but the offending project (bottom pane) has a GUID in the ProjectTypeGuids node in lowercase, while the working project has it in uppercase.  Starting with a simple solution, I changed the GUID in question to be all uppercase.  Success!

While I can't be certain, it appears that it's doing a case-sensitive string lookup on the ProjectTypeGuids, or at least that one.

If you encounter an issue like this, checking and comparing the GUIDs in your project file is quick and easy.

Tags: , , , , , , ,


3/30/2011 10:23:33 PM #

Jeffrey A. Miller

You used Great Migrations -- how was it?  I know Mark Juras, President of Great Migrations, LLC.  Do you know him too?

Jeffrey A. Miller United States

4/5/2011 4:24:26 AM #

Aaron Stemen

I do know Mark.  He's a friend of the family.  So, you can take the next statement with a grain of salt:

I think the migration process through them is really good.  It's much more flexible than the migration wizard that comes out of the box with Visual Studio or even what you would get from Artinsoft.

Having done some work with them, I have a real appreciation for some of the features of a strict language like C# over a much less strict language like VB6.  It's a complicated process that's simplified and quick through the use of their application.

Aaron Stemen United States

Comments are closed