Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS
with no warranties, and confer no rights. Additionally, views expressed
herein are my own and not those of my employer, Microsoft.
There are a couple of new features that have been added in the XNA Game Studio 3.0 beta that are intended to improve the development experience in Visual Studio that I want to briefly introduce. If you have a chance, I encourage you to download the XNA Game Studio 3.0 beta and give it a try. Please let us know if you find any bugs or have any feedback about the features described below or any of the other features in the product by using the Connect site.
Multiple Content Projects
In XNA Game Studio 2.0, the concept of a content project was introduced. However, each game project was limited to a single content project, which meant that sharing content between games required some additional work (such as creating a game library and including that library in each game project that you wanted to use the shared content in).
In XNA Game Studio 3.0, it is now possible to add and remove content projects directly within a game project. This allows you to include multiple content projects into your game project. You can do all of the following:
There are several possible uses for this feature. Here are a couple of examples:
XNA Game Studio has a feature that allows you to create a game project for one platform (Windows, Xbox 360 or Zune) and then create a copy of that project for one of the other supported platforms. Behind the scenes, a new .csproj file is created to represent the game for the new platform, and the appropriate changes are made to the .csproj file so references, pre-processor definitions, etc will be configured correctly for the new platform.
When you create a copy of a project for another platform, it will automatically be populated with the same code and content that existed in the original project at the time the copy was made. However, in previous versions of XNA Game Studio, any future additions, removals or renames to items in one of the projects would cause it to get out of sync with the other project. Stephen Styrchak posted some information a while ago on his blog about an add-in he wrote to automatically synchronize cross-platform projects in XNA Game Studio 2.0.
Starting in the XNA Game Studio 3.0 beta, we have included built-in support for cross-platform synchronization that is similar to Stephen's add-in. After creating a game project and then creating one or more cross-platform copies, XNA Game Studio 3.0 will automatically synchronize item additions and renames that occur in any of the projects in the cross-platform group.
It is important to note here that XNA Game Studio 3.0 will only synchronize projects that are in the same solution and are part of a "cross-platform group." This means that the projects have to have been added to the solution by creating copies of an existing game project as opposed to by using the Add New Project or Add Existing Project options in Visual Studio. You can tell whether or not 2 .csproj files are a part of the same cross-platform group by looking at the metadata in the project files. Every XNA Game Studio project should have a property named <XnaCrossPlatformGroupID> that is set to a GUID value. Projects that are a part of the same cross-platform group will have identical <XnaCrossPlatformGroupID> values in their .csproj files.
Something I have always wondered about (with my limited knowledge of the VS system): Why are the different platforms implemented as individual projects and not through the build configuration settings?
Hi Bjorn - Essentially, there are things that we do differently based on the platform that the game project targets that it wasn't possible for us to implement this purely via build configuration settings. For example, there are certain IDE settings that are only applicable to Windows games (such as ClickOnce publishing or adding web references), there is platform-specific handling of reference assemblies, there is platform-specific deployment logic, etc.
Thanks a lot!
Ok, that makes sense for 2.0 and below and a change to utilize VS 2008's multi-targetting thingy would have been to expensive, right? But then the VS.NET SDK is said to change tremendously with each version...
Hi Bjorn - XNA Game Studio 3.0 does support the multi-targeting features in VS 2008, but only for Windows games. For Windows, you can choose to target the desktop .NET Framework 2.0, 3.0 or 3.5 with your game. For Xbox 360 and Zune, there is only one supported version of the .NET Compact Framework that ships in XNA Game Studio for each of these platforms, so there are not multiple version to target, and therefore multi-targeting is disabled for those platforms.
There are some breaking changes in each version of the VS SDK, but for the most part, things are backwards compatible.
With the multi-targeting feature support I meant to choose the different platforms (as in: replace the current one-project-per-platform-approach with this feature), not .NET versions - but then I do not really know much about it, esp. if it would be possible at all :]
Hi Bjorn - The multi-targeting feature in VS 2008 is fairly limited and is specific to the .NET Framework versions 2.0, 3.0 and 3.5. It isn't extensible to the point that we'd be able to use it for XNA Game Studio project platforms.
Last week, I posted some high-level details about a couple of new Visual Studio features that are available