Deploying an Xbox 360 Game
XNA Game Studio Express can copy executable and media files to the Xbox 360 retail console once you are ready to deploy them. As you develop your Xbox 360 game, it is convenient to be able to deploy your game executable to your console quite frequently for testing purposes.
Before deploying, though, you will first have to establish a connection between the console and your computer, using the XNA Game Studio Express Options dialog box. For a detailed explanation of this process, see XNA Game Studio Express Xbox 360 Options Page.
Deploying Your Game
This procedure describes the steps needed to deploy your Xbox 360 game from XNA Game Studio Express to a console, assuming that you have successfully established a connection between that console and your computer.
Note
An XNA Framework game deployed to the Xbox 360 console cannot exceed a maximum size of 2 GB, which also means that any single file you deploy must be smaller than 2 GB.
To deploy your Xbox 360 game
Load an Xbox 360 Game project into XNA Game Studio Express.
Make sure the Output window is visible so you can follow the progress of your deployment in detail, and so you can tell where a problem occurred, if one does. To display the Output window, click Output on the View menu, or press CTRL+W followed by the letter O.
From the Games page of the Xbox Dashboard, select Demos and More and press the A controller button.
Select XNA Game Launcher and press the A controller button.
Select Launch and press the A controller button. This displays the XNA Game Launcher main page.
Select the Connect to Computer option and press the A controller button. The message Waiting for computer connection will be displayed. If you wish to cancel the operation, press the B controller button to return to XNA Game Launcher.
From XNA Game Studio Express, deploy the game by right-clicking the solution name and selecting Deploy Solution or selecting Deploy Solution from the Build menu.
Both the Output window of XNA Game Studio Express and the Connect to Computer screen display the progress of the deployment. A list of the deployed files and additional information is displayed during this process.
Press B to return to the XNA Game Launcher main page. From there, select My Games and press the A controller button.
A list of available games is displayed.
Select a game from this menu and press the A controller button, then choose Play Game and press the A controller button again to start the game.
Incremental Deployment
Incremental deployment is automatically enabled for XNA Game Studio Express projects. This means that the IDE tracks which files have already been deployed to your Xbox 360 console, and on subsequent deployments, only deploys files that have been updated since then. Also, if a file that was part of the previous deployment is no longer in the game, it is deleted from the console during deployment. (This only applies to files that were previously deployed, not to files that were generated on the console.) The output window reflects exactly what actions were taken during deployment.
A full deployment, which deletes any previous game files and copies the entire game to the console, is triggered by the following conditions.
- This is the first time the project has been deployed.
- A different configuration is being used than in the last deployment.
- A different device is being targeted than in the last deployment.
- The game was deleted from the Xbox 360 since the last deployment.
- The solution has been cleaned since the last deployment. (For more information about cleaning the solution, see the section below.)
If you cancel during a deployment, some files may not have transferred which will leave the game in an indeterminate state. The next incremental deployment will behave as if the last deployment never occurred and update the correct files on the Xbox 360 console.
Cleaning the Solution Before You Build
Cleaning your game solution before you build removes all intermediate and output files generated by the build, which forces the next build to regenerate everything.
If you select Rebuild on the build menu, the build automatically regenerates everything, but you may also want to clean your solution before doing a build. This is particularly true if you have changed a custom importer or processor in the Content Pipeline, or if you are installing a new importer or processor, because you then want to ensure that all files these new components build are rebuilt.
By default in Visual C# 2005 Express Edition, the Clean Solution option is not included in the Build menu, but you can easily add it if you want to make cleaning your solution convenient. Here's how to do it.
- In XNA Game Studio Express, right-click the menu or toolbar at the top of the window and click Customize.
- In the Customize dialog box, click once on the Build menu (or on any other menu where you want to add the command). This opens the menu and leaves it open.
- In the Commands tab of the Customize dialog box, make sure Build is selected in the Categories pane on the left. Then, from the Commands pane on the right, drag the Clean Solution command into the open Build menu and drop it where you want it.
- Click Close.
Now, whenever you want to clean the solution, you can click Clean Solution from the menu where you added it.
Deployment Troubleshooting
If you are unable to deploy your Xbox 360 game successfully, the following tips might help.
Invalid File Name
The length of the file name deployed to the Xbox 360 console must be 40 characters or less, and file names must use only ASCII (and high ASCII) characters. If a file name does not meet these requirements, an "Invalid File Name" error message is displayed in the Output window, showing the file name that caused the error.
If you don't follow these guidelines, your game deployment will not succeed. You will not be able to run the game after an unsuccessful deployment, even if a successfully deployed copy of the game previously existed on the Xbox 360 console. The unsuccessful deployment leaves the preexisting copy of the game in an indeterminate state.
You can resolve this issue by modifying the name of the source file so that it meets the file name requirements and then redeploying.
Deleting XNA Game Launcher Does Not Remove Games
Deleting XNA Game Launcher from the System blade or from the Demos and More section of the Games blade does not delete individual games that have been transferred to the console. After you delete XNA Game Launcher, you must individually delete any games transferred to the console.
Troubleshooting Your Connection
If you are unable to successfully establish a connection between your computer and your Xbox 360 console, the following tips might help.
Be sure your console is configured correctly
- You will need an XNA Creators Club membership, which you can purchase from the Xbox LIVE Marketplace.
- XNA Game Launcher must be installed on the console.
- You should be signed in to Xbox LIVE with an Xbox 360 gamer profile associated with your XNA Creators Club membership.
- XNA Game Launcher must be running on the console. This means the connection to Xbox LIVE must remain active; otherwise, XNA Game Launcher closes.
Use a key that has just been generated
The key generated by the console on the Connection Key page is good only for connecting one computer to one console under one user profile.
A key is valid until a computer connects to the Xbox 360 using that key, or until a new key is generated by the console. For example, if you delete a console from the list of consoles available for deployment, you cannot add it back again using the same key. Instead, you must generate a new key on the console and use that new key to connect the computer to the console.
You can establish only one connection listing at a time for a given gamer profile
If multiple computers connect to one Xbox, as often happens in homes, they cannot use the same gamer profile to create simultaneous connections. Similarly, if a computer has several user logins, only one of the users can form a connection with a console using a given gamer profile.
To establish multiple persistent connections to one console from multiple computers, you must specify a separate Xbox 360 gamer profile on the Xbox 360 console for each of the computers. When the console is signed in with the profile corresponding to a particular computer, the console can generate a connection key to establish a persistent connection with that computer. Subsequently, whenever signed in with the same profile, the console can connect again with that computer and receive deployments from it. Note that all of the gamer profiles in question must be members of the XNA Creators Club.
Alternatively, the different computers can share a single gamer profile one by one. Every time a different computer needs to connect, it can delete any previous connection and establish a new one, using a new key and the common gamer profile. There is no limit to the number of times you can create new keys and establish new connections.
The same thing is true of establishing multiple persistent connections to one console from multiple user accounts on a single computer: For each user account on the computer, specify a separate Xbox 360 gamer profile on the Xbox 360 console. When the console is signed in with the profile corresponding to a particular user account, the console can generate a connection key to establish a persistent connection with that account on the computer. Subsequently, whenever the console is signed in with that profile and that user is also signed in on the computer, the console can connect and receive deployments. Note that each of the gamer profiles in question must be members of the XNA Creators Club.
Again, different users can also share a single gamer profile serially, one after the other, by deleting any previous connection and establishing a new one every time a different user needs to connect, since there is no limit to the number of times new keys may be created and new connections established.
Your connection keys might have been modified
If a connection worked once and is now failing, the connection key for the console may have been changed accidentally. If this is the problem, you can fix it simply by adding a new connection, using a new key.
The computer and the console must be on the same subnet
If the computer and Xbox 360 are on different subnets, they cannot establish a connection properly. Typically, both machines should be connected to the same hub or router. It is best not to use a wireless connection, because a weak or noisy signal can make connection and deployment fail.
To determine whether your computer and console are on the same subnet, you can do the following:
- On your computer, open a command window (click Start, and then click All Programs, Accessories, and Command Prompt). At the command prompt, type ipconfig and press ENTER. Make note of both the IP address and of the subnet mask in the configuration listing that appears.
- On the console, go to the System blade of the Xbox Dashboard, select Network Settings and then Edit Settings. Again make note of the IP address and subnet mask.
Compare the settings to make sure that the computer and console are on the same subnet.
Check for firewall interference
In some cases, your firewall could be blocking communication between your computer and the Xbox 360 console. Verify that the following conditions have been met.
- The xnatrans.exe executable is not blocked on the computer.
- Incoming communication for UDP ports 3825 and 3835 is not blocked.
- Outgoing communication for UDP port 1000 is not blocked.
- Outgoing communication for TCP port 1001 is not blocked.
See Third-Party Firewall Settings for additional details.