Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I understand that an XNA project for XBox 360 will use a specialized version of the .NET Compact Framework. But let's say I want to release for both XBox 360 and Windows.

Will the XBox version (using compact framework) still work if distributed for Windows, or would I need to rebuild against the regular framework (or the non-Xbox CF) in order to distribute?

share|improve this question
add comment

2 Answers

up vote 15 down vote accepted

Yes, different platforms run different .net runtimes.

The way this works in xna 3/3.1/4 is you create your game project for a single platform (say, create a new Windows Xna game project in visual studio). In visual studios 'solution explorer', right click the project and then chooses 'create copy of project for X', where x is the platform you want the new project to target. Thats pretty much all there is to it. create copy of project

These two projects are kept in synch, anything you add to one will show up in the other. Use #if WINDOWS or #if XBOX or #if WINDOWS_PHONE blocks to add code that is specific to a single platform.

share|improve this answer
    
Ahh, that's why the sample projects have "Copy of X" in them. I assumed they were just manual copies, I didn't realize XNA+VS automated that. Very useful! And the picture demonstrates where the option is very nicely. Sounds like it would be best to start with an XBox project then and do a Windows copy if I'm planning for release on both from the start. –  CodexArcanum Oct 22 '10 at 18:06
    
Personaly id always start from a windows project, its easier to debug on windows and you get tools like perf hud and pix. It dosnt matter which way round you do it, but doing that way round kind of solidifies the idea of c main dev platform, but test early and often on 360. –  Cubed2D Oct 22 '10 at 18:42
add comment

You need to rebuild for Windows. There is a tool to automate the process of converting the visual studio projects. Since you started on the 360 and the compact framework you should be largely okay. Going the other way you can run into issues where you use .Net framework features that aren't supported by the compact framework.

The docs contain a section on differences between the two (for example, you can't set the processor affinity on Windows). If you're actually releasing your game on the PC you might run into compatibility issues. Eg, your render buffer format might not be supported, or your shaders might not compile. This is the curse of PC development though and not specific to XNA.

share|improve this answer
    
Nice to be aware that I might run into shader or buffer problems on PC as well. I assumed that XNA was hiding most of those little details but I guess some still slip through. –  CodexArcanum Oct 22 '10 at 18:20
    
Yes, PC hardware is wildly varied. But I have found that the xbox quirks to be harder to account for than features of modern mainstream graphic hardware. That a loose standard, i know :) –  Seth Battin Aug 22 '12 at 14:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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