Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Adding Game Data Files to Title Storage

Describes how to add game data files to the title storage location.

This topic describes how to add files to title storage that the game will access through stream I/O. This is the exceptional case, and is not recommended for most XNA Game Studio games. Instead, consider using the Content Pipeline to manage your game data most efficiently.

Adding files to Title Storage

Any file that your game needs at runtime can be added to the title storage location simply by adding the file to the root-level of your project in Visual Studio.

To add a data file to title storage

  1. Copy the file to your project directory.

  2. In Solution Explorer, right-click the project name, select Add, and then click Existing Item.


    The Add Existing Item dialog box appears.

  3. In the file types drop-down list, ensure the default setting of All Files (*.*) is selected.


  4. Select the name of the file you want to add to the project from the list, and then click Add.

    An entry for the file appears in your project in Solution Explorer.

  5. In Solution Explorer, click the file just added to view its properties. If the Properties window is not open, right-click the file name, and then click Properties.
  6. In the Properties window, change Build Action to None, and change Copy to Output Directory to Copy if newer.


The file now can be accessed by passing its name to TitleContainer.OpenStream as described in Reading Game Data from Title Storage.

You can add data files to a subfolder in your project, but you will need to refer to the subfolder name when accessing the content with OpenStream. For example, if you place a file named data.txt in a GameData folder in your project, you'll pass the string GameData/data.txt to OpenStream.

Community Additions

© 2016 Microsoft