23

I've created a game for an assignment in Visual Studio 2012 and the university I'm at uses 2010 and it won't open! It mentions something about NET Framework 4.5. How can I convert my project so it will open in 2010?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user2141272
  • 297
  • 2
  • 5
  • 11
  • Not one for pointing out the obvious, but could you not just make a new 2010 project and import all your code files? – Meirion Hughes Mar 14 '13 at 09:13
  • possible duplicate of [How to downgrade from Visual Studio 2012 project to Visual Studio 2008](http://stackoverflow.com/questions/13507901/how-to-downgrade-from-visual-studio-2012-project-to-visual-studio-2008) – Mark Rotteveel Mar 14 '13 at 09:13
  • possible duplicate of [Converting VS2012 Solution to VS2010](http://stackoverflow.com/questions/12143383/converting-vs2012-solution-to-vs2010) – Alex Filipovici Mar 14 '13 at 09:15
  • @Mark: Not a duplicate, since you don't need to follow the same steps to go from 2012->2010 as you do for 2012->2008 – Matthew Watson Mar 14 '13 at 09:16
  • 1
    Here's the quick workaround (because you need it ASAP :)): [http://stackoverflow.com/a/13458225/674700](http://stackoverflow.com/a/13458225/674700). – Alex Filipovici Mar 14 '13 at 09:17
  • The point here is: Visual Studio 2010 can not open .NET 4.5 projects (at least you can't work on those projects). If you only have supported projects in your solution file and VS2010 has SP1 applied, you should be able to switch between both – Sascha Mar 14 '13 at 09:21
  • @MatthewWatson They are not exact duplicates I admit, but I would think that a combination of both answers to that question would fix the issue as well – Mark Rotteveel Mar 14 '13 at 09:23

7 Answers7

73

It takes three step:

Step 1

Open solution file (.sln) in a text editor and change

 Microsoft Visual Studio Solution File, Format Version 12.00

to

 Microsoft Visual Studio Solution File, Format Version 11.00

Step 2

Open application configuration file (App.config) in a text editor and change

sku=".NETFramework,Version=v4.5"

to

sku=".NETFramework,Version=v4.0"

Step 3

Open project file (for C# language .csproj) in a text editor and change

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

to

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

Now enjoy your project in VS 2010 !

vahid
  • 731
  • 5
  • 2
5

You may only need to open the project in Visual Studio 2012, and go to the project's properties page.

On the Application tab, locate the Target Framework setting, and change it to .Net Framework 4.

After that, you should be able to open it in Visual Studio 2010.

Also see Converting VS2012 Solution to VS2010, but so far I haven't had to do any conversions on VS2012-created projects to open them ins VS2010 - but YMMV.

[EDIT]

I just tested this again (to be sure) by creating a .Net 4.5 project in VS2012, and verified that I couldn't open it in VS2010. Then I opened it in VS2012 again and changed the framework version to .Net 4.0. After that I could open it in VS2010.

Note that I didn't have to make any other changes. However, this is on a computer with VS2010 and VS2012 installed, so it's possible that installing VS2012 might do something with VS2010 to make it work...

Community
  • 1
  • 1
Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
  • Do I change it to .NET Framework 4 or Framework 4 Client Profile? – user2141272 Mar 14 '13 at 09:23
  • If you are using full .Net 4.5 at the moment, change it to Framework 4. If you're currently using .Net 4.5 Client Profile, you can probably change it to .Net 4 Client Profile. If it still doesn't work, see the thread that Alex mentioned earlier: http://stackoverflow.com/a/13458225/674700 – Matthew Watson Mar 14 '13 at 09:28
  • I figured it out. Visual Studio Express 2010 is version 10 and installing XNA 4.0 upgrades it to version 11. It loads my version 11 projects! :) – Xonatron Feb 02 '16 at 20:24
3

I have done this at work

Open .sln file with notepad

Change the two lines below

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

To

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

and hey presto the solution now opens in VS2010

0

You can create a new project in Visual Studio 2010 and then right click in the solution explorer > Add > Existing item. To pull through all of files in your 2012 project.

Oliver
  • 8,794
  • 2
  • 40
  • 60
0

Either create a new solution in VS2010 and add all existing files from your VS2012 or compare the .sln file to a .sln file freshly created with VS2010. At the top you'll see some version information that should be changed. Also compare the .csproj files and change any version information accordingly and the target framework.

Oliver
  • 43,366
  • 8
  • 94
  • 151
0

Missing library or framework could also cause this problem. For example, if you want to open a MVC4 or Silver Light project but you don't have these libraries installed at your PC.

steamfood
  • 474
  • 3
  • 10
0

Open .sln file and Change Format Version to 12.0 to 11.0

Munnoo
  • 1
  • 4