Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:54:21+00:00 2026-06-18T05:54:21+00:00

currently I’ using XNA 4.0 Game Studio and the Window Game Statement Management template

  • 0

currently I’ using XNA 4.0 Game Studio and the Window Game Statement Management template which is provide by Visual Studio 2010 to develop a game. Is there any suggestion about how to save and load the state of a game? Previously I’ve develop a window phone game and the data is stored inside IsolatedStorage. Is there any similarity for the Window Game?

         using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForAssembly())
            {
                using(IsolatedStorageFileStream stream = file.OpenFile("class123.xml",FileMode.Create))
                {
                    XmlWriterSettings setting = new XmlWriterSettings();
                    setting.Indent = true;
                    using(XmlWriter writer = XmlWriter.Create(stream,setting))
                    {
                        XmlSerializer serializer = new XmlSerializer(typeof(Student));
                        serializer.Serialize(stream,new Student(){Name = "AhLim"});
                    }

                    using (XmlReader reader = XmlReader.Create(stream))
                    {
                        XmlSerializer serializer = new XmlSerializer(typeof(Student));
                        studentA = (Student)serializer.Deserialize(reader);
                    }
                }
            }

Here’s the code i recently used in Window Game Applicaiton. However, when i reach to Deserialize part, it show InvalidOperationException was unhandled and error on XML document (0,0) . May i know where’s the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:54:22+00:00Added an answer on June 18, 2026 at 5:54 am

    Try

     serializer.Serialize(writer, new Student() { Name = "AhLim" });
    

    instead of

     serializer.Serialize(stream, new Student() { Name = "AhLim" });
    

    Looks like IsolatedStorageFileStream is using the wrong encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am loooking for a way to develop an algorithm which is supposed
Currently, I have a Rails 3.2.9 Engine which is using sass-rails . When I
Currently I am using HTML files for parts of my user interface. I display
currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView
Currently I have 2 ways of displaying images in a cell, which way will
Currently I am looking to develop an application for mobile devices that would be
Currently, I am using the following command to change dos2unix line endings, but this
Currently we use log4net of version 1.2.10.0 and we should start using some 3rd
Currently we are using Trac . Tickets are good for tracking tasks and related
Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.