views:

1499

answers:

8

Is there a way to open a solution-file saved in Visual studio 2010 beta 2 in Visual studio 2008? ... or maybe a way to convert it?

When i tried to open it in VS 2008 i get an error saying "The selected file is a solution file, but was created by a newer version of this application and cannot be opened."

A: 

I fought with this very problem today. What I did was create a VS2008 project and simply added in the files from the other project. Most code written in 2010 really doesn't use 2010 features--at least for the code I was looking at it imported the files without any problems.

Jeff
+2  A: 

It is not a supported scenario to open a .sln file created with 2010 in 2008. This is true for trying to open any .sln file saved in a newer version of Visual Studio with an older one.

What you can do is open up the .sln file in notepad and decrement the version number by 1. This will allow you to open the .sln file but the operation will still likely fail as you'll have to convert all of the projects as well.

JaredPar
A: 

Visual Studio's project and solution files are plain text.

You need to open the .sln and .csproj files in a text editor, compare the VS2010 versions to VS2008 versions, and modify the version numbers to match.

SLaks
+4  A: 

If you open up the .csproj file in a text editor (it's just XML) you'll see a line like:

<ProductVersion>9.0.30729</ProductVersion>

(this is from a VS 2008 project)

The first line of a 2008 .sln file reads as follows:

Microsoft Visual Studio Solution File, Format Version 10.00

The 2010 version numbers will be different - just change them to these values (or the ones you get from creating a new 2008 project on your system).

Just take a backup of the files first.

ChrisF
I also had to change <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebAppli....to <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v9.0\WebAppli...in one of the csproj-files.Thank you, all!
Torsten41
@Torsten41 - I should have said there might be other lines that would need to be modified.
ChrisF
A: 

You'd have to compare the .sln and .*proj files schemas between the versions. I know that the structure is dramatically different from 2003 to 2008. In the end, you are better off creating a new project and copying the files over between the two

phsr
A: 

Why not create a new VS2008 solution manually and add in the source code instead of hacking at the .sln file. Remember VS2010 is early beta and not ready and the timeline for release has been pushed back due to the growing number of people complaining about it.

Hope this helps, Best regards, Tom.

tommieb75
A: 

While what other users have stated is true, if the project contains or (may not be 100% exact but look for something along those lines)

You will need to remove them as the syntax for 3.5 client, and 4.0 client is different in VS2010, than in 2008.

sevenalive