11

I want to write an XNA game using .NET 4.5, so that I can use one of the new features that isn't in .NET 4.0.

Is there any way to do this? VS2012 doesn't have XNA listed anywhere in the list of New Projects.

I have also seen this question: How to install XNA game studio on Visual Studio 2012?

But I'm only a hobbyist and I couldn't get xcopy to work (plus I don't think I have the game studio, only the framework). I was wondering if it was possible to instead target .NET 4.5 in VS2010, anyway.

Thanks in advance.

Community
  • 1
  • 1
Xenoprimate
  • 7,691
  • 15
  • 58
  • 95
  • 2
    No, you'd better write this off as an option until the Xbox and Phone specific runtimes catch up. If ever. – Hans Passant Jun 30 '12 at 11:12
  • 1
    Most news looks like XNA won't catch the train to Windows 8-- MS is pushing C/C++ for Windows Phone 8 and presumably Windows 8 as well. You may want to look into alternatives like Monogame and SharpDX. – A-Type Jul 02 '12 at 13:16
  • @A-Type This is the option I'd use. The develop3D branch of the MonoDevelop project has a W8 port in an advanced state of completion. – Ani Jul 20 '12 at 15:16
  • Which feature are you trying to use? There might be a library add-on that enables something similar. –  Jul 20 '12 at 15:06

3 Answers3

7

You can change the project file of a XNA game to let it use .Net 4.5. Open the .csproj file and change the following lines:

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>

to read:

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

and on the next compile the binary is .Net 4.5. At our company we use it to create XNA games with the new Kinect One and it works splendidly. We tried MonoGame and although its great it was not as stable as we hoped on Windows in our specific case.

Wouter
  • 2,170
  • 1
  • 28
  • 58
5

I have removed the original answer as it is no longer relevant.

MonoGame is a reimplementation of XNA built to run with the Mono platform, allowing you to easily port existing XNA games or build new games using a framework designed to operate like XNA.

Microsoft no longer supports XNA but endorses MonoGame, going as far as to release games from Microsoft Studios built on MonoGame and more recently (at the time of writing) announcing forthcoming support for MonoGame on Xbox One.

ravibhagw
  • 1,740
  • 17
  • 28
5

Some have been successful using MonoGame on Win8+Metro.

http://monogame.codeplex.com/

As stated in the other answer, XNA isn't being supported on Metro on its own, but MonoGame gives you the majority of the APIs. You should be able to just add a reference to the DLL and write your app as an XNA Game.

In answer to your other question, I think MS has said that VS2010 won't support .Net 4.5 development.

Joe Castro
  • 2,181
  • 18
  • 24