Opening an ASP.NET MVC project without having ASP.NET MVC installed: The project type is not supported by this installation

Projects built with ASP.NET MVC are what are known as "flavored projects." This means that instead of being an entirely new project type, ASP.NET MVC projects merely extend a different kind of existing project type. Specifically, the projects extend the Web Application Project type.

If you try to open a flavored project and don't have that particular flavored project system installed, you get to see this little slice of heaven:

Visual Studio error message: The project type is not supported by this installation

If you select "OK" then Visual Studio will continue, but the project will not be loaded:

Solution Explorer: Project unavailable

Well, then, what do you do to continue? All you have to do is edit the project file to remove the flavoring. Right-click on the project, and select "Edit MyProjectName.vbproj".

image

This will launch Visual Studio's project file editor (with Intellisense, in case you didn't know!). Towards the top you'll see a list of project types associated with this project, each one represented by a GUID.

  <ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>

The first GUID there (the one that starts with "603c") is the one used by ASP.NET MVC projects. Remove that GUID so you end up with:

  <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>

Save the project file and close it.

Now reload the project:

image

And you'll be able to work on the project once again. The only thing you won't be able to use is MVC project-specific features such as the "Add View" menu option.

I find myself doing this very often since my work machine is always in a bizarre state with respect to ASP.NET MVC and I often don't have the project type installed. This is much faster than trying to install MVC just so I can inspect a project.

12 Comments

Comments have been disabled for this content.