Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

June, 2011

  • Aaron Stebner's WebLog

    How to create a solution with XNA Game Studio 4.0 Windows Phone 7.0 and 7.1 projects

    • 0 Comments

    The Windows Phone Developer Tools 7.1 allows you to create applications and games that target both Windows Phone OS 7.0 and Windows Phone OS 7.1.  In some cases, you may want to create separate versions of an application or game that target both versions of the Windows Phone OS and that share common code.  There is not a way to automatically create a Visual Studio solution and projects to do that.  Here are some manual steps you can use to create XNA Game Studio 4.0 projects that target Windows Phone 7.0 and 7.1 and that share code and content:

    1. Create a new XNA Game Studio 4.0 Windows Phone game project that targets Windows Phone OS 7.0.
    2. Close the solution.
    3. Create a new XNA Game Studio 4.0 Windows Phone game project that targets Windows Phone OS 7.1.
    4. Close the solution.
    5. Copy the project file from step 3 above into the same directory as the project from step 1.
    6. Update the RootNamespace and AssemblyName values in the project from step 3 to match the values in the project from step 1.
    7. Update the OutputPath values for each build configuration in the projects from step 1 and step 3 so that each project will build to unique output locations.
    8. Update the content reference in the project from step 3 to point to the same content project as the project from step 1.
    9. If needed, add a new value to the DefineConstants list in the projects from step 1 and step 3 so that you can IFDEF code to compile only for the Windows Phone 7.0 and/or Windows Phone 7.1 project.
    10. Update the solution (.sln) file from step 1 to include the project from step 3.

    You can find a sample solution that I created that I have already completed all of the above steps for at http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog_Tools/WPGameMultiTargetingSample.zip.

    The above steps will create a solution and a set of projects that behave differently than a traditional multi-platform solution in XNA Game Studio that is created by starting a project for one platform and then creating a copy of it for another platform via the Create Copy of Project menu item in the Visual Studio IDE.  Projects created with Create Copy of Project will be automatically synchronized behind the scenes so that if you add, remove or rename a file in one project, it is reflected in the other copies.  After completing the above steps, you will need to make sure that you manually synchronize any file add, remove or rename operations.  Changing code within files that have already been added to both projects will be picked up when you build either one of the projects though.

  • Aaron Stebner's WebLog

    How to manually downgrade an XNA Game Studio Windows Phone 7.1 game project back to 7.0

    • 0 Comments

    The Windows Phone Developer Tools 7.1 allows you to create and develop applications and games that target both Windows Phone OS 7.0 and Windows Phone OS 7.1.  The Visual Studio project file for an application or game can only target one version of the Windows Phone OS.  You can upgrade a project that targets 7.0 to target 7.1 in the Visual Studio UI, but once you upgrade, you cannot downgrade it from the Visual Studio UI.  Because of that, the upgrade UI recommends making a backup of your 7.0 project before proceeding with the upgrade process.

    If you have an XNA Game Studio Windows Phone 7.0 game project that you have upgraded to 7.1 and you didn’t make a backup copy before the upgrade, you can use the following steps to manually downgrade it to 7.0:

    1. Make sure that your project and solution are not open in Visual Studio
    2. Open the project file (*.csproj or *.vbproj) in a text editor such as Notepad
    3. Locate the following property value:

      <XnaRefreshLevel>1</XnaRefreshLevel>

    4. Remove the property value entirely or set the value to 0
    5. Re-open the project in Visual Studio
Page 1 of 1 (2 items)