AutoRecover
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.
=====
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:
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:
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:
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:
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:
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.
Comments
Anonymous
June 29, 2010
Awesome. Thanks for explaining this one Zain!Anonymous
June 29, 2010
You bet Kelvin! :)Anonymous
September 05, 2010
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 ............Anonymous
September 30, 2010
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 MyDocsVS2010Backup FilesMyProject 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.Anonymous
September 30, 2010
@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. ZAnonymous
October 14, 2010
how to change the directory for the backup files?Anonymous
November 16, 2010
The comment has been removedAnonymous
December 14, 2010
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.Anonymous
March 05, 2011
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!Anonymous
March 10, 2011
The comment has been removedAnonymous
April 13, 2011
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!! :(Anonymous
May 30, 2011
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...Anonymous
July 24, 2011
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.Anonymous
September 05, 2011
Visual Studio 2010 Express, not (Menu: Tools -> Options -> Environment -> AutoRecover ??????)Anonymous
January 11, 2012
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.Anonymous
March 26, 2012
I agree this 'feature' is broken big time. My setting are the default 5min/7days. I had a crash and lost a single file in a solution - COMPLETELY, as in the whole file was overwritten with 0x00's. VS restarted like nothing happened. I check the backup directory - no files. Use Recuva to scan the backup directory - NO DELETED files either whatsoever, like nothing has ever been written there.Anonymous
May 16, 2012
The comment has been removedAnonymous
May 30, 2012
Check if you got some "enc_temp_folder" folder in your solution, i could restore one of my files thanks to tmp files there. Hoping this will be debugged soon, it's quite an important feature...Anonymous
August 08, 2012
The location is my problem. In Company is everything fine, but from home with a vpn connection I have to wait 20 seconds every time because my home dir is mapped to a net shareAnonymous
September 09, 2012
I have lost 3 days worth of work twice!!!!!!!!!!!!! OMG, you can only image how upset I am.Anonymous
October 22, 2012
First, recovered files are stored at ...My DocumentsVisual Studio <version>Backup Files<projectname> First, how wrong is that??? They are saved to "My Documents" which, is in most cases, highly unlikely to be "..", and in many corporate cases likely to be on a shared network drive. This can cause VS to freeze up every 5 minutes (depending on the setting) as it tries to access a slow network resource to auto save and to freeze on save as it cleans up autosaved files.Anonymous
March 10, 2013
Just lost 14+ hours of work. Nice ... just love throwing my life away. Thanks Microsoft.Anonymous
November 29, 2013
The feature is not working. The directory is empty and I lost a day of work!!!!!!!!!!!!!!!!!Anonymous
December 05, 2013
The comment has been removedAnonymous
December 12, 2013
The comment has been removedAnonymous
December 14, 2013
The comment has been removedAnonymous
December 14, 2013
The comment has been removedAnonymous
January 21, 2014
Same story....almost lost hours of work! BUT my home folder is actually located on a network drive which have the feature "Restore previos version" (a Windows server storage feature).....an I manage to restore my auto-recovery files from there :-)Anonymous
March 24, 2014
I lost my a day work... Come on Microsoft. Please resolve this issue ASAP...Anonymous
April 10, 2014
thank you,I really need this now...Anonymous
September 22, 2014
The comment has been removedAnonymous
September 29, 2014
Lost 8k of code (half of a day), twice. System is on SSD disk. Seems that bug is initiated at backup folder cleanup (last time = 7 days ago) when compiling a project. VS2010/C++.Anonymous
October 26, 2014
Would changing the default directory affect itAnonymous
February 12, 2015
confused What to do is this will work or not suggest meAnonymous
February 19, 2015
Same bad experience here, big crash when compiling, BSOD on Windows 7 x64 (first time I ever had one...). The result: the .cpp file I was working on was filled with NULL, and backup folder was empty...fortunately I made a manual backup of my project some days ago so i did not lose too much data. This AutoRecover option can't be trusted! find another auto backup solution for your project!Anonymous
June 10, 2015
STILL not working, apparently ... else a MicroSerf would have posted a fix ... typical.Anonymous
October 20, 2015
The comment has been removed