Building for Xbox 360 and Windows in one project

This is (sort of) possible! It seems that the GSE team worked on implementing this feature for the 1.0 release, but had other priorities and weren’t able to complete it. Leaf came up with a project template that will allow you to build for multiple platforms (i.e. the Xbox 360 and Windows) in one project. You should have a good deal of experience with programming for both platforms before doing this though, as the feature isn’t officially supported, and you might run into problems that will be extremely difficult to diagnose. In other words, you’ll have problems with intellisense, references and more.

There is a forum thread on this topic on the XNA Forums in which Stephen Styrchak discusses why this wasn’t included as a feature in the first release of XNA GSE. Basically, there wasn’t enough time to properly implement it and they felt it was more of an advanced feature (i.e. they expected more beginners to be using XNA GSE, and didn’t want to cause them headaches).

The safest way to do this continues to be by adding your source files as links. To do this, set up your project for one platform, then add a new project for the other platform. Create a directory structure in the new project that mirrors the old project (e.g. if you have Effects, Resources and Classes directories in the first project, create those in the second project, with the same names). Then right click on the folder you want to copy the files to (or the project, if you want to copy to the base directory), and select “Add -> Existing Item.” Then, in the “Add Existing Item” dialog box, find the file you want to add. click on the file, then click the arrow by the “Add” button, and select “Add As Link.” This way, you’ll only have one copy of the file hanging around, and you won’t have to keep copying it every time you make a change.

Adding a file as a link

I’ve started a topic on Microsoft Connect about this issue. If you’d like to see this officially supported in the next version of XNA Game Studio Pro/Express, go vote on it here.

Leave a Reply