Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XNA 4.0 with C# .NET 4.5?

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.

like image 290
Xenoprimate Avatar asked Jun 30 '12 09:06

Xenoprimate


People also ask

What is XNA C#?

XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio 2010 to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

Is Microsoft XNA Framework redistributable 4.0 important?

The XNA Framework Redistributable provides the necessary runtime components to execute a game on Windows that was developed using Microsoft XNA Game Studio 4.0. This release contains improved functionality as well as new features.

Is Microsoft XNA Framework redistributable 4.0 refresh needed?

This release contains improved functionality as well as new features. Installation of this runtime is unnecessary on systems with Microsoft XNA Game Studio 4.0 Refresh already installed.

Is Microsoft XNA still supported?

As of January 2013, XNA is no longer being developed, and it is not compatible with Windows Runtime (the API for developing Metro-style apps), which was introduced with Windows 8.


1 Answers

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.

like image 173
Wouter Avatar answered Sep 20 '22 17:09

Wouter