I'm creating an Xbox application and I have this problem with the content pipeline. Loading .xnb files is not a problem but I can't seem to find any helpful tutorials on writing via the content pipeline. I want to write an XML whenever the user presses a custom made "save" button. I've searched the web for "saving game sate" etc. but so far I haven't found a solution for my case.

So, summarized: is there a way to write data (in XML format) via the content pipeline, if my Save() method is called?



1 Answer 1



You can't save data on the xbox via the content pipeline.

You can however use other methods (standard .net once you've got a file stream). See here for an example: https://stackoverflow.com/questions/3723287/good-example-of-xna-4-0-to-save-game-data

See also: http://robotfootgames.com/xna-tutorials/92-xna-tutorial-savingloading-on-xbox-360-40

The content pipeline is for build time files (they are compiled).
See What is the content pipeline (MSDN).

It works well when you want to perform a lot of pre-processing to go from your original file (maybe an image file) to your runtime class (like a Texture2D with mipmap levels), but that's not the only way to load files on the xbox (so you don't have to save to the XNB format).

  • \$\begingroup\$ Thank you very much for your fast response. I didn't know that it was impossible to write via the content pipeline, I could have been searching for ever for an answer. I will try it with the code on stackoverflow your link provided, Thanks! \$\endgroup\$
    – DenEddy
    Mar 16, 2012 at 9:27
  • \$\begingroup\$ A small note - you can write via the content pipeline on windows providing you have Game Studio Express installed (i.e. for developers, but not players). People often use this for creating level editors. \$\endgroup\$ Mar 16, 2012 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .