XNA 4.0 for VS 2013 – Step by Step

A little context

New Project: XNA Template Options shown in Visual Studio 2013

New Project: XNA Template Options shown in Visual Studio 2013

I’m updating one of my PCs to allow for XNA development with Visual Studio 2013, so I thought I’d put all the steps in one location. If you’re running Windows 8, there are a few more steps that you must do first.

There is an alternative to the steps listed below. I have not tried it, but the community has put together an XNA Refresh package on CodePlex that should achieve the same goals. There are additional details about this refresh on the Microsoft Developer Network. Of course, there’s still hope that Microsoft will provide official support. If that is something you’d like to see, I recommend you sign the petition.

Finally, remember that MonoGame offers the ability to deploy XNA-based games on Linux, MacOS, Android, iOS, and even the PlayStation. Just know that you’ll need Xamarin’s tools for Android, iOS, and Mac deployment. This works with Visual Studio or their own update of MonoDevelop, that is: Xamarin Studio.

In the mean time, whichever XNA and IDE you choose be aware that Visual Studio version numbers are a little confusing:

Common Name Internal Name
Visual Studio 2008 Version 9.0
Visual Studio 2010 Version 10.0
Visual Studio 2012 Version 11.0
Visual Studio 2013 Version 12.0

Step by step guide:

(This has been adapted and updated from an old Stack Overflow post).

  1. Install Visual Studio 2010 (Visual C# 2010 Express should be sufficient)
  2. Install XNA Game Studio 4.0
  3. Install Visual Studio 2013
  4. Copy XNA Extensions from the Visual Studio 10 extensions directory to Visual Studio 13:
    1. Run Command Prompt as Administrator (find cmd.exe and right-click “Run as Administrator”)
    2. Paste the following code into the terminal window:
      xcopy /e "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0" "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0"
      
    3. When prompted, “XNA Game Studio 4.0” is a Directory .. so press “D”
  5. Use your favorite text editor to update the supported version. That is, in the newly created folder edit the file “extension.vsixmanifest” to support VS13 (that is, Version 12.0), replacing the following section of XML:
      <SupportedProducts>
          <VisualStudio Version="10.0">
            <Edition>VSTS</Edition>
            <Edition>VSTD</Edition>
            <Edition>Pro</Edition>
            <Edition>VCSExpress</Edition>
            <Edition>VPDExpress</Edition>
          </VisualStudio>
        </SupportedProducts>
    

    With:

      <SupportedProducts>
          <VisualStudio Version="12.0">
            <Edition>VSTS</Edition>
            <Edition>VSTD</Edition>
            <Edition>Pro</Edition>
            <Edition>VCSExpress</Edition>
            <Edition>VPDExpress</Edition>
          </VisualStudio>
        </SupportedProducts>
    
  6. Additional steps if you’ve run Visual Studio 2013 at least once:
    1. Delete the Visual Studio 2013 cache files by pasting the following into the terminal:

      del %localappdata%\Microsoft\VisualStudio\12.0\Extensions\*.cache
    2. Finally, let Visual Studio 2013 know that you have new extensions available. Again, paste the following into the terminal:
      "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /setup
Adding an External Tool

Adding an External Tool in Visual Studio 2013

Optional Step: To package the XNA files to .ccgame files (in order to share or deploy to the Xbox360), you can either do that from the command line or add a shortcut as an external tool. One of my students posted a script for this purpose. Just save the code as a .bat file in a convenient location and follow the instructions for adding the ‘External Tool’ in Visual Studio. The result will be a shortcut as shown below.

XNA Package Utility (ccgame) shown in External Tools menu of VS2013

XNA Package Utility (ccgame) shown in External Tools menu of VS2013

That’s pretty much it. For more information and source details, check out here and here.

Leave a Reply