Using the Project Upgrade Wizard for XNA Game Studio 2.0
Introduction
This is a guide to using the Project Upgrade Wizard for XNA Game Studio 2.0, which converts and upgrades an existing XNA Game Studio Express game project and saves it as a new XNA Game Studio 2.0 game project.
Overview
XNA Game Studio has several differences from XNA Game Studio Express 1.0 and XNA Game Studio Express 1.0 Refresh, and therefore existing XNA Game Studio Express 1.0 and 1.0 Refresh games must be converted before they will load into XNA Game Studio 2.0. Some of the differences have to do with the project files and assembly references that must be converted. Other differences have to do with the XNA Framework methods and properties and require code changes.
The Project Upgrade Wizard for XNA Game Studio 2.0 converts the project files and assembly references. It will not change the game's code, however. Code changes must be done manually.
For more information about the overall process of upgrading games from XNA Game Studio Express 1.0 and XNA Game Studio Express 1.0 Refresh, see the Upgrade Guide: XNA Game Studio Express to XNA Game Studio 2.0 topic in the XNA Game Studio 2.0 documentation.
How the Project Upgrade Wizard for XNA Game Studio 2.0 Works
The Project Upgrade Wizard for XNA Game Studio 2.0 only upgrades single projects, not solutions. If your game solution consists of several projects, each project must be upgraded separately, and added to a new solution created to hold the new projects.
Note: The upgraded project is a copy of the original. The upgrade wizard does not replace the original project.
Specifically, the Project Upgrade Wizard for XNA Game Studio 2.0 performs the following tasks:
- The wizard copies everything in the project directory, including all subdirectories. This may include files not directly related to the project, depending on your directory structure. Exceptions to this are the original solution file, which you should create anew, the bin and obj directories, and all project files. You must either upgrade each project file separately if it is a game project, or re-reference it if it is not a game project.
- It places all content in the nested content project. All other files remain in the game project.
If the source project has one or more directories containing both content and non-content files, these directories will appear twice in the converted project. In other words, all content files in the original directory appear under a node (of the same name) under the nested content project; the remaining files appear under another node (of the same name) under the main game project. Even though these nodes appear distinct, they both represent the same directory on disk. Deleting the directory from either node will delete the physical directory on disk, making all its files inaccessible from the other node.
- To avoid deployment conflicts, the wizard changes the assembly GUID (Guid attribute).
- The wizard removes project-to-project references. If you referenced a game project, you should upgrade it separately and reference that. If you referenced a regular project, you can re-add the reference.
- The wizard removes Content Pipeline references. You should manually upgrade the Content Pipeline extension project and reference it from the new content project. For more information on this, see the "Option 2: Manual Upgrade" section of the article "Upgrade Guide: XNA Game Studio Express to XNA Game Studio 2.0" in the XNA Game Studio 2.0 product documentation.
- The wizard upgrades only two assembly references: Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game. These references are upgraded to point to the 2.0 versions of those assemblies. The wizard does not upgrade other assembly references.
- It places content in the new project according to how it is built. All content built with the Content Pipeline is placed in the nested content project. Files with their Build Action set to "Content," but not built with the Content Pipeline, are placed in the code project instead.
- By default, the wizard creates the nested content project in the game project directory. This differs from the XNA Game Studio 2.0 experience, where the content project and all content files are placed in a Content directory in the game project. This behavior is the result of XNA Game Studio Express 1.0 being able to contain content files anywhere within a project directory.
If the original project has all content files in a Content directory, the wizard places the upgraded content project in this directory. This matches the native XNA Game Studio 2.0 experience. However, placement does not occur if content files were located outside the Content directory, added to the project as links, or if the directory had a name other than "Content".
- For any items added to the original project using links with relative paths, the wizard changes them so that they use absolute paths.
- If your thumbnail file is built with the Content Pipeline, the file appears in both the code project and the nested content project.
Using the Project Upgrade Wizard for XNA Game Studio 2.0
To use the Project Upgrade Wizard for XNA Game Studio 2.0:
- Start Visual Studio.
If you are using Microsoft Visual C# 2005 Express Edition:
- From the File menu, click New Project, or press CTRL+SHIFT+N. The New Project dialog box appears.
- In the Project types list, click XNA Game Studio 2.0.
- In the Templates list, click Project Upgrade Wizard (2.0).
- Type the name for the upgraded game project in the Name text box. You can also modify the default values for the Location and Solution Name controls.
- Click OK.
If you are using another supported version of Microsoft Visual Studio tools:
- From the File menu, click New, and then Project, or press CTRL+SHIFT+N. The New Project dialog box appears.
- In the Project types list, click XNA Game Studio 2.0.
- In the Templates list, click Project Upgrade Wizard (2.0).
- Type the name for the upgraded game project in the Name text box. You can also modify the default values for the Location and Solution Name controls.
- Click OK.
The Project Upgrade Wizard for XNA Game Studio 2.0 appears.
- In the Which XNA Game Studio Express 1.0 project would you like to upgrade? edit box, enter the path to the game project you wish to upgrade. Or click Browse to navigate to the game project you wish to upgrade.
- Click Upgrade.
The Project Upgrade Wizard for XNA Game Studio 2.0 converts your game to the XNA Framework 2.0.
- After conversion is complete, click Finish to exit the wizard. Your upgraded game project is then loaded into Visual Studio.
- Build the solution and fix any errors that result from changes in the XNA Framework 2.0 assemblies or that result from project configuration issues.
Note: The upgraded game may not work immediately after you run the Project Upgrade Wizard for XNA Game Studio 2.0. You may need to make assembly reference changes and code changes before your game works with XNA Framework 2.0. For more information about these changes, see the Upgrade Guide: XNA Game Studio Express to XNA Game Studio 2.0 and XNA Framework Changes in XNA Game Studio 2.0 topics in the XNA Game Studio 2.0 product documentation.