.NET Tips and Tricks

Blog archive

Stop Being Bugged About Changed Files

Every once in a while, you have a file open in one of your Visual Studio tabs and the file is updated on the disk. Unlike when any unopened files/folders in Solution Explorer are changed, Visual Studio notices this change. The result is that you get a dialog telling you that the “file has been modified outside of the editor” and are asked if you “want to reload it?” There are, essentially, two buttons on the dialog: Yes and No.

I have never clicked No. Not once. Not ever.

So, the other day, I took the plunge and turned off this dialog: I shouldn’t ever see that message again. Instead, my changed file will be quietly refreshed. If you also want to get rid of the dialog, first go to the Tools menu and select Options. From the Environment treeview on the left side of the resulting dialog, drill down to the Documents node and, on the right, check the option under “Detect when file is changed.” This will cause Visual Studio to skip the dialog and just reload the changed version of the file.

Depending on which version of Visual Studio you have, that option will be called “Autoload Changes, If Saved” or the more obvious “Reload modified files unless there are unsaved changes.” Either way, as long as you haven’t made changes to the file, the changed file will automatically (and silently) be refreshed in the editor tab. If you’ve made changes to the file and haven’t saved them yet, you’ll get a dialog asking if you want to keep your changes.

Quite frankly, I don’t know why it isn’t the default.

Posted by Peter Vogel on 11/17/2015


comments powered by Disqus

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube