How does Visual Studio know if you are loading a non-supported project type?
Posted: (EET/GMT+2)
Have you ever tried to open an older Visual Studio project in the latest Visual Studio version, only to notice that Visual Studio stops with an error message saying the project type you are trying to open isn't supported? Last time I noticed when I tried opening an ASP.NET MVC 1 project written with Visual Studio 2008 project into Visual Studio 2012.
Now, if you have seen this error, you might wonder where Visual Studio looks for the project type. It is found in the .csproj file and more specifically, in the ProjectTypeGuids XML element of that file. For instance, here's an example of the said element if you have an ASP.NET MVC 1 web application written with C#:
<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};
{349c5851-65df-11da-9384-00065b846f21};
{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
(All of the above would appear on a single line.) Notice how the element contains three GUID values: these indicate the type of the project, the version of the components (as in MVC 1 vs. 2, 3 or 4) and the programming language.
Now, in my case, because Visual Studio 2012 doesn't support MVC 1 applications, to get the project to load, you would need either to migrate the project, or remove the offending GUIDs by hand. For instance, the first GUID marks ASP.NET MVC 1, so if you would replace with the GUID of, say, ASP.NET MVC 4, you'd be all good.
Here's a list of particularly common ProjectTypeGuid values:
- C# project: {fae04ec0-301f-11d3-bf4b-00c04f79efbc}
- ASP.NET web application: {349c5851-65df-11da-9384-00065b846f21}
- ASP.NET MVC 1 application: {F85E285D-A4E0-4152-9332-AB1D724D3325}
- ASP.NET MVC 4 application: {E3E379DF-F4C6-4180-9B81-6769533ABE47}
For more information, check the specifications for the XML project files Visual Studio and MSBuild use.
Hope this helps!