Monday, December 06, 2010

Opening Visual Studio 2005 Projects in Visual Studio 2010/2008

We recently had to modify legacy source code created in Visual Studio 2005. On opening the project file in VS 2010, it started the Conversion Wizard.


After clicking the usual Next, Next and Finish, it gave the message "Some errors occurred during Conversion. For more information, see the Conversion Report". The report gave 1 Error.

On trying to re-open the project file, it gave the message.

The project file 'D:\Test\MyProj.csproj' cannot be opened. The project type is not supported by this installation.

It was a SharePoint project, and it was looking for Visual Studio Extensions for SharePoint.

We had only Visual Studio 2010 on our machines and trying to install the Visual Studio extensions for VS 2010 will not help as we could not find the right 64 bit VS 2010 version.

I used an old trick learnt in my early programming days. Opening Visual Studio project file directly in notepad and modifying the same. The .csproj file is an XML file and we were interested in the ProjectTypeGuids which stores reference to the project type.

<ProjectTypeGuids>{9E5D3E2D-E4E2-418e-8D80-2F0DA9A94F9A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>


The GUID's stand for
{9E5D3E2D-E4E2-418e-8D80-2F0DA9A94F9A} = SharePoint Solution
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} = Class Library

We removed the reference to SharePoint Solution GUID (and its semicolon separator), saved the file in notepad. And now when we open the project, the error is gone. Hurray!!!

5 comments:

Scott said...

You've saved me! I've been killing myself over this all day trying to work some vs 2005 code in 2008. This finally did the trick. Thanks for sharing!

Shankara said...

Wow. This is what I was looking for.. Thanx..

markm247 said...

Did the trick for me... Thanks Vinay!

Muhammad Zuhairi said...

How do you know what does the guid stands for?Where do you check?

Vinay Bhatia said...

@Muhammad:
I am not sure if Microsoft has documented the same.

Below is an blog with a list of GUID's and project types:
http://www.mztools.com/articles/2008/mz2008017.aspx

However, the above blog does not seem to be updated with recent releases.
You might have to Search on Google/Bing with your GUID to know more about its project type.