I have an XNA game for WINDOWS which I want to work on XBOX also.

I've designed the game so that when I want to connect it to an XBOX, all I have to do is supply a different input class,

And I would do that by checking with the preprocessor macros and checking if it's windows or xbox.

But then, when I tried to do Create a copy of this project for XBOX in VisualStudio, it created several new projects (the real XNA project and some of it's dependencies), and it complained about things not working for C# 3.0 and that I should use C# 4.0 instead, which I didn't find out how to do either.

What's the correct way to make both WINDOWS and XBOX versions of an XNA game?

And also, how do I really run the game on XBOX? I haven't found a good tutorial on how I do that... also I don't have an XboxLive membership so if there's a hacky way to do that, it's better

  • \$\begingroup\$ What version XNA and what version of the dotNet are you using in the original project? \$\endgroup\$ – Felsir Aug 27 '16 at 16:46
  • \$\begingroup\$ Xna 4, dotnet 4 \$\endgroup\$ – Giora Guttsait Aug 27 '16 at 20:11

If you've already supplied the input methods, then this code should work (change in Program.cs)

#if XBOX
static void Main (string[] args)
    using (Game1 game = new Game1())

When you open a new project, the #if says WINDOWS || XBOX, but, if you just want an Xbox game, then change it to Xbox only.

| improve this answer | |
  • \$\begingroup\$ I've left the project already, but for the sake of the answer, the problem is not about allowing only XBOX. It's about how to check the game in XBOX when I don't have xbox GOLD, and also compiling the game correctly for XBOX. \$\endgroup\$ – Giora Guttsait Dec 4 '16 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.