AutoRecover

Tips Search

AutoRecover

  • Comments 30

Menu:  Tools -> Options -> Environment -> AutoRecover
Versions:  2008,2010,2012,2013
Published:  6/30/2010
Code:  vstipEnv0019

 

=====

WARNING: Read the comments associated with this post as there are multiple complaints that this features doesn't work as expected. Read this thread from the engineering folks about usage with versions VS2010 and older.

http://connect.microsoft.com/VisualStudio/feedback/details/731561/autorecover-on-new-files-does-not-work

=====

 

Perhaps your best friend is the AutoRecover feature.  It can be a real life saver if the dev environment crashes or there is a power outage or a meteor hits your cube (okay, maybe not that last one).  It's very simple to use, just go to Tools -> Options -> Environment -> AutoRecover:

image

 

If you want to turn this feature off you can deselect the "Save AutoRecover information every" checkbox.  Of course, if you do this we will all laugh at you when you lose important work because you didn't have it and I will personally blog about it so everyone knows--you might want to leave it on--just saying.  Here is what the other options do:

 

X minutes - determines how often files have AutoRecover information saved.  The default is 5 minutes but you can adjust up or down depending on usage.  There is an inverse relationship between this value and the frequency of your updates to code.  If you make more frequent updates to code then have a lower number here.  Fewer updates to code mean you can increase this number if you desire.  If you are going to make a mistake here make it on the side of a number that is too low rather than too high.  It's better to take any performance hit from file I/O than to lose a ton of work.

 

X days - used to decide how long AutoRecover files are kept in the Backup Files directory.  The default is 7 days which is usually adequate for most situations.  If you work with a lot of projects over a short period of time then you may want to decrease this number to keep the Backup Files directory more clear.  If you are going to guess on this value then it's better to guess high and lower the number as needed. 

 

 

 

Let's be clear on what a is exactly saved and where it is saved.  First, recovered files are stored at \...\My Documents\Visual Studio <version>\Backup Files\<projectname>.  Not every file is saved here.  Let me show you an example:

 

Here is the backup folder for one of my solutions when I create it in Visual Studio:

image

 

Obviously the folder is empty.  Now let me make a change to a file and save the change.  Then I'll wait 5 minutes to see the result:

image

 

Still nothing because there is no need to recover a saved file.  But let me make a change to a file without saving it and wait another 5 minutes:

image

 

NOW we have AutoRecover information because if there is crash we will have to make a decision to recover the unsaved changes or keep the last saved version.  This is essentially the function of AutoRecover.

 

 

 

When you do finally have to recover a file, this is the dialog you will get:

image

 

 

 

 

Recovered files - lists the file(s) that can be recovered with a a checkbox to select/deselect the file as well as basic information.

 

<File Name> Summary - shows detailed information about the currently selected file including date/time info, location of the backup file, and destination location where the file will be recovered to.

 

Recover Selected Files - performs a recovery action on the file(s) selected copying the recovered source file to the previously indicated destination.

 

Do Not Recover - closes the dialog box without recovering any of the files listed.

  • Awesome. Thanks for explaining this one Zain!

  • You bet Kelvin! :)

  • I have the autorecovery option to default i.e. 5min, 7days.

    ..was working on a report (SSRS) for the whole day (i.e. >>>>5mins)but when my VS crashed the autorecovery option had recoverd the version which was a day old. It was a very bad day ............

  • FAIL.  No auto recover files after a VS2010 crash.  Lost a little over an hour of work even though autorecover enabled and set to 5min/7days.  Nothing in the MyDocs\VS2010\Backup Files\MyProject either.

    I'm not the only one - I'm seeing posts from others with similar results.  Funny thing is that I've seen it work recently on the same machine, and even after restarting VS2010 I see files being created in that folder as I make changes.

    Houston, we have a bug.

  • @Sameer and Scott

    I'm pinging the team to find out if this is a know issue or what the situation is here.  I'll post back here if I find out anything.

    Z

  • how to change the directory for the backup files?

  • This feature does not seem to work.  Twice I have lost my connection (remotely logging in and working on a workstation at work).  SQL recovers the queries I have open but VS 2010 just ignores anything I had opened and did not have saved.  VERY FRUSTRATING!!!!!!  My environment is a 64 bit Win 7 workstation, is something about 64 Bit OS?  Why can't this work the way other programs work?  Is it because I have my projects linked to TFS?  I am just frustrated because I lost about 2 hours of work - I know, save often and I usually do, but this time I didn't and updated several classes and all of that work is poof gone because my internet went down at hmoe and I lost connection to my workstation.  It has been over a month, Z - anybody there have an answer why this "feature" is DOA?

  • Lost about 2 hours of work, even though that feature usually works for me. VS2010 crashed, then it got automatically auto-restarted (usually I would see the "recover files" dialog), but it immediately crashed again (have no idea why, maybe the fact that it was the 4th VS running had something to do with it); the dialog did not come up when I started it again.

    64-bit WinXP, VS2010.

  • I think the VS team has tried to make this tool too clever. When I do save my work, the autorecover file is deleted. "Well, you don't need it then because it's saved." Not true. If the drive fails or if I'm working from a RAM drive, then I'm still hosed. The very old paradigm of just saving a .bak of everything in a location of my own choosing was a simple and very effective recovery model. I think someone tried to fix something that wasn't broken. Now I'm looking for a plugin for this functionality. I guess you get what you pay for...no wait!! This thing is *dang* expensive!

  • Also lost an hour and a half of work...i just went to look for some documents when windows automatic updates restarted my pc....when visual studio 2010 automatically restarted, there was nothing to recover and no files in the folder either..........damn frustrating..........I agree with StarTrekRedneck...why not leave the recovery files in the folder and delete only after the 7th day??

  • I agree aswell, just experienced blue screen during run after a CTRL+S - an ASPX file became 1 KB wit no info and no recover file to be found!! :(

  • I can confirm a not working backup strategy - at least concerning this auto recovery stuff.

    got an out of memory exception and suddenly after a vs restart there were 4k lines of code deleted. had to restore from backup but all recent changes were lost.

    this already happend twice...

  • Have same bad experience. More than other cases, main .cs file of project is damaged fully on VS crash. Auto recover folder is empty.

    Lost a lot of experimental work.

  • Visual Studio 2010 Express,

    not (Menu:  Tools -> Options -> Environment -> AutoRecover ??????)

  • Agree with some previous comments - AutoRecovery set to "on" in VS2010, VS2010 crashes, Backup Files folder empty, fortunately *only* 2 hours work lost.

    When VS restarted, no acknowledgement whatsoever that anything abnormal has happened.

Page 1 of 2 (30 items) 12
Leave a Comment
  • Please add 6 and 2 and type the answer here:
  • Post