127

I'm working in VB project with VS 2012 and after finish I try to add setup project.

I didn't find it (because the Setup Project was discontinued after VS2010) so I switched to VS2010 but the problem is the project wont open and I get this message:

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

I tried this article : http://www.codeproject.com/Tips/80953/Converting-VS2010-Solution-to-VS2008 and tried to convert from 2012 to 2010 but same message appears.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
HokaHelal
  • 1,568
  • 2
  • 15
  • 21
  • Why don't you just use VS2010 to create a single setup-project - as far as i remember you don't need to inlcude projects and can add the files by yourself – Random Dev Aug 27 '12 at 14:01
  • okay,this can be a work around the idea is we always include the setup with the project in same solution to make the compilation/deployment fast – HokaHelal Aug 27 '12 at 14:24
  • 1
    Do you have sp1 on vs2010? I think you need the service pack for it to open 2012 project/solution files. – Georgi Stoyanov Aug 29 '12 at 09:50

7 Answers7

305

Open you solution file in notepad. Make 2 changes

  1. Replace "Format Version 12.00" with "Format Version 11.00" (without quotes.)
  2. Replace "# Visual Studio 2012" with "# Visual Studio 2010" (without quotes.)
starball
  • 20,030
  • 7
  • 43
  • 238
Bhavin
  • 3,074
  • 1
  • 13
  • 3
  • 3
    Is there a downside to doing this? It seems too easy to be true. – kbeal2k Dec 20 '12 at 16:53
  • 4
    It didn't work for me it still maintained it was incompatible? – David Jan 11 '13 at 11:57
  • This along with Loada's answer worked perfectly. Thank you both. – One-One Feb 16 '13 at 08:53
  • 3
    Thanks for this tip! Works even for downgrading an ASP.NET web api project. In addition to adapting Format Version 12.00 to Format Version 11.00 in sln and adjusting TargetFrameworkVersion element in csproj from 4.5 > 4.0; I had to remove httpRuntime element in web.config and adjust compilation targetFramework attribute in web.config from 4.5 > 4.0 – AardVark71 Mar 29 '13 at 09:02
  • 2
    Fantastic, can't believe there is no backward compatibility though. – Stephen Murby Apr 27 '13 at 10:03
  • 1
    I just fell into this trap using VS2013 - changed the Format back to 11 and everything was fine again in VS2010 - thanks! – Surfbutler Oct 18 '13 at 12:18
  • that's funny, I was going to download visual 2012 until I tried your solution... what a shame that vs2010 says 'older version cannot open' whereas it's only a matter of two numbers, not of the description langage of the .sln files. – reuns Sep 17 '15 at 22:04
121

Just to elaborate on Bhavin's excellent answer - editing the solution file works but you may still get the incompatible error (as David reported) if you had .NET 4.5 selected as the default .NET version in your VS2012 project and your VS2010 enviroment doesn't support that.

To quickly fix that, open the VS2012 .csproj file in a text editor and change the TargetFrameworkVersion down to 4.0 (from 4.5). VS2010 will then happily load the "edited" solution and projects.

You'll also have to edit an app.config files that have references to .NET 4.5 in a similar way to allow them to run on a .NET 4.0 environment.

Rory Solley
  • 1,435
  • 1
  • 9
  • 6
  • 5
    This along with Bhavin's answer worked perfectly. Thank you both. – One-One Feb 16 '13 at 08:52
  • 2
    Thanks for this tip! Works even for downgrading an ASP.NET web api project. In addition to adapting Format Version 12.00 to Format Version 11.00 in sln and adjusting TargetFrameworkVersion element in csproj from 4.5 > 4.0; I had to remove httpRuntime element in web.config and adjust compilation targetFramework attribute in web.config from 4.5 > 4.0 – AardVark71 Mar 29 '13 at 09:03
  • *Additionally* you may, as I did, have to go through your .vcproj files and change the platform toolset from v110 to v100. – Xyon Sep 09 '14 at 21:15
2

I had a similar problem and none of the solutions above worked, so I went with an old standby that always works:

  1. Rename the folder containing the project
  2. Make a brand new project with the same name with 2010
  3. Diff the two folders and->
  4. Copy all source files directly
  5. Ignore bin/debug/release etc
  6. Diff the .csproj and copy over all lines that are relevant.
  7. If the .sln file only has one project, ignore it. If it's complex, then diff it as well.

That almost always works if you've spent 10 minutes at it and can't get it.

Note that for similar problems with older versions (2008, 2005) you can usually get away with just changing the version in the .csproj and either changing the version in the .sln or discarding it, but this doesn't seem to work for 2013.

Wade Hatler
  • 1,785
  • 20
  • 18
2

the simplest solution is.....open your website in vs2013 and go to Debug->WebsiteProperties (last option) a new window will open..

in this window go to "Build" option and change .net framework version from 4.5 to 4.0.....then select ok. [note: this step will only work if your project does not have dependencies with vs2013...]

Now open your website in vs2010

rakeshyadvanshi
  • 294
  • 3
  • 9
1

Solution of VS2010 is supported by VS2012. Solution of VS2012 isn't supported by VS2010 --> one-way upgrade only. VS2012 doesn't support setup projects. Find here more about VS2010/VS2012 compatibility: http://msdn.microsoft.com/en-us/library/hh266747(v=vs.110).aspx

SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85
  • 1
    Reading through that document says that there ARE things that will work just fine between the two - meaning you could create a project/solution in VS2012 and open it with no problems in VS2010. The document does indicate, however, that there are things that, if used in 2012, will not allow you to open in 2010. http://stackoverflow.com/questions/10902865/is-visual-studio-2012-csproj-backward-compatible-with-2010 is another good, simple answer. – brazilianldsjaguar Dec 03 '12 at 20:14
  • If you read it carefully, then you should see a slight difference: projects created in VS2010 work in VS2012, not other way round. "...you can open a project that was created in Visual Studio 2010 SP1..." – Piotr Lewandowski Jan 29 '14 at 16:46
1

Open the project file and not the solution. The project will be converted by the Wizard, and after converted, when you build the project, a new Solution will be generated as a VS2010 one.

Michael Haephrati
  • 3,660
  • 1
  • 33
  • 56
0

Simple solution which worked for me.

  1. Install Vim editor for windows.
  2. Open VS 2012 project solution using Vim editor and modify the version targetting Visual studio solution 10.
  3. Open solution with Visual studio 2010.. and continue with your work ;)
Guest
  • 1