This project is read-only.

Game Progress Not Being Saved

Feb 7, 2012 at 1:23 AM
Edited Feb 7, 2012 at 1:24 AM

I'm having problems with game progress not being saved.  It seems to be intermittant (I haven't figured out what the situation is that causes this.)  I've tried debugging, but it seems sometimes the OnExiting method is not called when navigating out of the application.  Has anyone else seen this?  Does anyone have any ideas how this could be fixed?  I've received some negative ratings in the marketplace due to this issue and I really would like to resolve this for everyone.

I have not changed any of the code in Initialize or OnExiting.

Feb 8, 2012 at 11:03 AM

You could try the following:

Inside SampleGame.cs, override OnDeactivated, and then copy the code from OnExiting into OnDeactivated.

protected override void OnDeactivated(object sender, EventArgs args)
            using (var bw = ProfileManager.CurrentProfile.Write(ProgressTracker.ProgressFile))



            base.OnDeactivated(sender, args);
Feb 13, 2012 at 3:49 AM


Thanks.  This seems to have worked.  You may want to include this in the source code.



Feb 13, 2012 at 4:18 AM

Wasn't me, Michael for the help win!  :-)

Good idea