Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can configure Visual Studio to automatically back up files or not. You can also specify if you want to restore modified files if Visual Studio shuts down unexpectedly.
Open the Tools > Options pane, and expand the All Settings > Environment > AutoRecover section.
Select the Automatically back up unsaved files checkbox.
Use this option to instruct Visual Studio to automatically save files that are open in the editor. For previously saved files, Visual Studio saves a copy of the file in %LocalAppData%\Microsoft\VisualStudio\BackupFiles\[projectname]. If the file is new and unsaved, Visual Studio autosaves it by using a randomly generated file name.
Set the Backup interval (minutes) to the number of minutes between automatics file saves.
Set the Autorecover information lifetime (days) to the number of days a saved file can be auto-recovered from a backup. In other words, the maximum age of a backup.
Open the Tools > Options dialog, and expand the Environment > AutoRecover section.
Select the Save AutoRecover information every [n] minutes checkbox and specify the number of minutes.
Use this option to customize how often a file is automatically saved in the editor. For previously saved files, Visual Studio saves a copy of the file in %LocalAppData%\Microsoft\VisualStudio\BackupFiles\[projectname]. If the file is new and unsaved, Visual Studio autosaves it by using a randomly generated file name.
Select the Keep AutoRecover information for [n] days checkbox and specify the number of days.
Use this option to specify how long Visual Studio keeps files created for autorecovery.
Select OK.
Restore unsaved work with Hot Exit
When enabled, Hot Exit preserves session state when you close Visual Studio normally and restores it the next time you open Visual Studio. It is separate from AutoRecover, which creates periodic backups for recovery after an unexpected shutdown.
In Visual Studio 2026 version 18.11, enable Hot Exit by opening Tools > Options, expanding All Settings > Projects and Solutions > General, and selecting Reopen unsaved documents on solution load or empty environment.
In Visual Studio 2026 version 18.10, Hot Exit was a preview feature and was off by default. To enable it in that version, go to Tools > Options > Preview Features > Hot Exit.
Hot Exit preserves:
- Unsaved files.
- Unsaved changes to previously saved files.
- Undo functionality for saved files, including Ctrl+Z.
- Tab and window layout.
For preferences that control reopening documents and Solution Explorer state for solutions and folders, see Projects and Solutions options.