14

I have a VS project (made by someone else), and when I try to open it on Visual Studio 2008, I get the following error message:

"The selected file is a solution file, but was created by a newer version of this application and cannot be opened"

I would have thought VS was backwards compatible. Is there any way I can open this?

109221793
  • 16,477
  • 38
  • 108
  • 160
  • Exists another way for this problem [You can try this][1] [1]: http://stackoverflow.com/questions/12143383/converting-vs2012-solution-to-vs2010?answertab=votes#tab-top – Martin Sch Jan 27 '14 at 17:36

3 Answers3

39

You can edit the sln and csproj/vbproj files by hand and try that way, I've used this method with no side effects. In the sln file the first lines for VS2010 will say

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010

and for a VS2008 solution:

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008

Also, in a 2010 project file you may find a section like

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

which will need to be modified as

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

With only these 2 types of changes I was able to open the solution & projects with VS 2008. Of course other differences may appear but if you have time you can always use a try/fail method until you manage it.

CyberDude
  • 8,541
  • 5
  • 29
  • 47
  • 2
    Confirmed as working for VS2012 --> VS2010 transition. `` modification was not necessary, though. – Máté Gelei Jun 10 '13 at 09:13
  • 1
    Confirmed, working for VS13 -> 10. Like post above, not required. – triunenature Nov 27 '13 at 22:34
  • this way I did a successful 2008 -> 2005 transition. I also had to modify the `.vcproj` file (an xml), the attribute from `Version="9.00"` to `Version="8.00"`. – n611x007 Jul 28 '14 at 10:25
  • It would seem, provided you have backups, you can replace the .sln and .*proj files with the pre-problem versions of those files. After opening a VS 2003 project in VS 2008 and then trying to open it again in VS 2003, I changed one section in the *.sln file, namely from "Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008" to "Microsoft Visual Studio Solution File, Format Version 7.1 # Visual Studio 2003" But then I had to also replace the newer proj files with the old backups, which were "missing the 'VisualStudioProject' section." – B. Clay Shannon-B. Crow Raven Oct 28 '14 at 18:27
  • Confirmed as working for VS2015 --> VS2010 transition. Like post above, not required – Theotonio Feb 06 '18 at 16:05
17

VS is backwards compatible, yes - you can open a VS 2005 solution file in VS 2008, for example. It's not forward compatible though - presumably that solution has been created by someone with VS 2010. EDIT: According to comments, with VS2010 SP1, you can open VS2012 solutions. I haven't verified this myself.

Fortunately, although the solution files aren't compatible, I believe you should be able to create a new solution in VS 2008 and add the existing project files created with 2010, so long as they haven't used any VS2010-specific features (either in the project structure or in the code itself). If the code targets .NET 4, you may need to adjust the project file to retarget it to .NET 3.5, too.

You may well see a warning about this (an unknown tools version, or something like that) - but it may very well work. I have a number of projects which have separate solution files for VS2008 and VS2010, but which use the same project files.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • thanks for the reply. This project has a LARGE amount of project files. Would it just be easier to get VS 2010? – 109221793 Sep 21 '10 at 09:14
  • @TaraW, it seems multi-selecting a bunch of csproj files would be a lot less work than installing a VS2010 version. For the rest 2010 is not a bad idea of course. – H H Sep 21 '10 at 09:19
  • @TaraWalsh: If getting VS2010 is an option, then I'd do that anyway. It's nicer than VS2008, and you'll get the new features of C#4/VB10, .NET 4 etc. – Jon Skeet Sep 21 '10 at 09:24
  • VS2010 can open open solutions of VS2012 (Forward Compatible) if sp1 is installed. – kroiz Jun 15 '14 at 11:54
  • @kroiz: Thanks - I've added a comment to that effect. – Jon Skeet Jun 15 '14 at 11:58
6

Solution:

Step 1: Go to your project location where the project's . sln file is kept and then Right click on it, choose "Properties". Un check "Read Only" as like given below:

Step 2: Again Go to the location where the project's . sln file is kept and then Right click on it to open it with notepad and change the "Microsoft Visual Studio Solution File, Format Version 12.00" to "Microsoft Visual Studio Solution File, Format Version 11.00" on the file.