title: System.FormatException occured in mscorlib.dll while reading I/O stream for loading games on XNA
body: <p>First of here is the code:</p>
  
  <pre><code>            if (Global.SaveDevice.FileExists(Global.containerName, Global.Challenges))
          {
              Global.SaveDevice.Load(
                  Global.containerName,
                  Global.Challenges,
                  stream =&gt;
                  {
                      using (StreamReader reader = new StreamReader(stream))
                      {
                          Challenges.CompleteCount = int.Parse(reader.ReadLine());
                          Challenges.Colorist = bool.Parse(reader.ReadLine());
                          Challenges.ConsecutiveI = bool.Parse(reader.ReadLine());
                          Challenges.ConsecutiveII = bool.Parse(reader.ReadLine());
                          Challenges.ConsecutiveIII = bool.Parse(reader.ReadLine());
                          Challenges.ConsecutiveIV = bool.Parse(reader.ReadLine());
                          Challenges.CountDownWizardI = bool.Parse(reader.ReadLine());
                          Challenges.CountDownWizardII = bool.Parse(reader.ReadLine());
                          Challenges.CountDownWizardIII = bool.Parse(reader.ReadLine());
                          Challenges.MultiplierI = bool.Parse(reader.ReadLine());
                          Challenges.MultiplierII = bool.Parse(reader.ReadLine());
                          Challenges.MultiplierIII = bool.Parse(reader.ReadLine());
                          Challenges.MultiplierIV = bool.Parse(reader.ReadLine());
                          Challenges.OneUpI = bool.Parse(reader.ReadLine());
                          Challenges.OneUpII = bool.Parse(reader.ReadLine());
                          Challenges.OneUpIII = bool.Parse(reader.ReadLine());
                          Challenges.OneUpIV = bool.Parse(reader.ReadLine());
                          Challenges.PongWizardI = bool.Parse(reader.ReadLine());
                          Challenges.PongWizardII = bool.Parse(reader.ReadLine());
                          Challenges.PongWizardIII = bool.Parse(reader.ReadLine());
                          Challenges.ScoreI = bool.Parse(reader.ReadLine());
                          Challenges.ScoreII = bool.Parse(reader.ReadLine());
                          Challenges.ScoreIII = bool.Parse(reader.ReadLine());
                          Challenges.ScoreIV = bool.Parse(reader.ReadLine());
                          Challenges.ScoreV = bool.Parse(reader.ReadLine());
                          Challenges.StarShifterWizardI = bool.Parse(reader.ReadLine());
                          Challenges.StarShifterWizardII = bool.Parse(reader.ReadLine());
                          Challenges.StarShifterWizardIII = bool.Parse(reader.ReadLine());
                      }
                  });
  </code></pre>
  
  <p>I get a "System.FormatException occured in mscorlib.dll" for line 12 ( Challenges.ConsecutiveI = bool.Parse(reader.ReadLine()); ) and if I comment it out I also receive it for the following lines when parsing but I don't get the exception in the first two lines of parsing. What I'm trying to do here is load a bunch of stuff using Nick Gravelyn's EasyStorage sample and its worked fine for saving objects in different classes with different errr I think they a called "sub containers" such as Global.Challenges and then Global.Options ect but yeah I'm stumped as to whats the source of the problem.</p>
  
  <p>Here is the last two lines of the call stack as well:</p>
  
  <blockquote>
    <p>GameStateManagementSample.exe!GameStateManagement.ChallengesScreen..ctor.AnonymousMethod__0(System.IO.Stream stream) Line 42 + 0x6 bytes    C#
        EasyStorage.dll!EasyStorage.SaveDevice.Load(string containerName, string fileName, EasyStorage.FileAction loadAction) Line 75 + 0x7 bytes   C#</p>
  </blockquote>
  
  <p>Thanks for your help!</p>