The idea of the “Integrated Development Experience” is a tool that brings all the systems a developer needs to develop their application into a single place. Coding, debugging, publishing, profiling… these are all tools that Visual Studio brings to our developers. Just as a general contractor doesn’t solve every problem with a hammer, however, we’re aware that Visual Studio isn’t the only tool in the developer toolkit.
One pain point we’ve been hearing about more and more is one that comes up when switching from one tool to another. Specifically, when you arrive at your other tool if you’ve been using Visual Studio without saving your code, that code shown in your other tool may be out of date. Then, when you edit the code in the other tool, your code is out of sync and it’s an ordeal trying to put everything back together.
Starting with 17.2 Preview 1, the new autosave feature will help with this. Use Visual Studio Search (Ctrl+Q) and look for “autosave”. That will take you to the Environment\Documents page in Tools\Options.

If “Automatically save files when Visual Studio is in the background” is checked, any time Visual Studio loses focus, usually as you change to another application in Windows, VS will attempt to save every dirty document in the IDE. This will include project files, solution files and even miscellaneous files that aren’t part of the project or solution. If saving a file fails for any reason (for instance, the file is read-only on disc), Visual Studio will keep your changes in the editor and simply leave the file dirty. The intent is that when you switch to another tool, after a moment, all your changes in VS will be committed to disk. While most developers will benefit from this, code files on slower disks or on remote servers will make a lot more save operations, and developers should keep that fact in mind when enabling autosave.
It’s worth mentioning that folks who are taking advantage of the “Code Cleanup on Save” feature from 17.1 will find that autosave does not trigger a Code Cleanup. We felt that it would be somewhat disruptive if it happened too often. Code Cleanup on Save will only trigger when you explicitly save the file, either through a command like Ctrl+S or implicitly as part of a build.
What do you think?
We’ve had suggestions in the past that some developers would like an even more aggressive autosave mechanism. Some developers would like Visual Studio to commit their changes to disk when Visual Studio goes idle after a set amount of time has passed. Another suggestion is to save when switching documents. If you’re the kind of developer who would find that useful, we’d love to hear from you. You can join the conversation here.
Please let us know how this feature works for you. Are you using it? Is it being too aggressive or not aggressive enough? How could we improve it? Please let us know your thoughts. We read all the suggestions provided on Developer Community as well as the comments on this blog post.
A good2have feature if that’s your style. My style, however, is smashing that Ctrl+S like it owes me money, whether I’m in Word, Notepad or VS/VS Code or Photoshop, and I’m ok staying with that 🙂
Am keen to try for a hot reload scenario (external tooling). One thing I’ve noticed is that it doesn’t behave the same as Ctrl+Shift+S in that extensions don’t execute. I have the Whitespace Visualizer extension installed, which strips unnecessary whitespace when saving. It works fine with Ctrl+Shift+S, but not with this feature.
Also, I’m very doubtful that I will want this feature on for all solutions in the long term as it will probably cause me a bunch of confusion. It really feels like it should be on a per solution basis.
Thanks for the feedback. Would you mind suggesting that here? I'd love to capture this suggestion.
The way Autosave is designed is that extensions need to opt into saves invoked via autosave. We were actively concerned that if extensions were being too aggressive here, it might result in some very uncomfortable situations, particularly if we extend autosave to act on a timer or on idle. Right now, we're finalizing a few pieces of this story, so I don't believe we've got the documentation available for extension authors to connect to the Autosave, but we should be providing that soon.
I downloaded Visual Studio 2022 about 2 months ago, and have been writing code since downloading the software. I have noticed something that rather bothers me somewhat. In previous versions of Visual Studio, when I successfully compiled a project, it automatically generated an application (.exe) file. In Visual Studio 2022, I have noticed that the application (.exe) file is no longer being generated. Am I missing something in the software setup or something? Is there something that I need to do to get Visual Studio 2022 to automatically generate the application (.exe) files when a project is successfully compiled without...
Adding a controversial feature like autosave, but then you see there are critical issues like https://developercommunity.visualstudio.com/t/1593340 causing people to be unable to use 2022 at all, that haven’t had an update in 4 months.
Priorities?
Priorities? They have it. Probably, inverted.