dlanod
dlanod

Reputation: 9020

How do I stop Visual Studio prompting me for changes on unopened files?

Sometimes when using Visual Studio it displays a prompt with a filename:

This file has been modified outside the source
Do you want to reload it?

However I don't have that file open in Visual Studio. In my case, the files I was being prompted for were temporary debug files that only existed during my build unless I was compiling in a debug mode.

How do I stop Visual Studio prompting me for files I do not have open?

Upvotes: 1

Views: 405

Answers (1)

dlanod
dlanod

Reputation: 9020

There are two cases where this can occur, and one way to disable the behaviour totally.

The trickiest I've found is if you have breakpoints set in code files that you don't have open or don't exist or exist only temporarily. Visual Studio will prompt you for any changes to these files, which in my case was on every compilation as I had breakpoints in a debug file (as per my question). To fix this you can:

  • Generate the debug file, open it and remove any breakpoints in it.
  • Delete all breakpoints using Ctrl-Shift-F9 or the "Delete All Breakpoints" action under the Debug menu.

Alternatively opening the file you are being prompted for and closing it can also resolve this issue in some cases.

Finally, you can disable the prompting behaviour totally by unchecking the option at Tools > Options > Documents > "Detect when a file is changed outside the environment".

Upvotes: 2

Related Questions