VS2008: Disable asking whether to reload files changed outside the IDE
Asked Answered
P

5

19

I have a Visual Studio 2008 project where some code files are generated with each build (a parser, integrated via MSBuild aka editing the *.csproj file). VS does not know about the generated nature of these files (i.e. they are not the result of a "Custom Tool). So they "change" with every build, naturally. And VS2008 asks me after every build if I would like to reload those files:

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

That would be ok if I had one of those files opened and in front of me, but I get these modal dialogs even with none of the code files opened.

So my question is: Is there a way to disable this dialog, per project, per solution or globally?

Thanks!

Priorate answered 16/7, 2009 at 19:24 Comment(0)
I
54

For VS2008: Tools > Options > Documents > Detect when a file is changed outside the environment

For VS2010/2012/2013/2015: Tools > Options > Environment > Documents > Detect when a file is changed outside the environment

Indomitable answered 16/7, 2009 at 19:47 Comment(2)
My (customized, and French localicez) Visual Studio instance shows Tools / Options / Environment / Documents / ... am I the only one?Trainman
See my second note below. In VS-2010 there is a sub-item under: "Detect when a file is changed outside the environment." It's called: "Auto-load changes, if saved." When I checked this option (along with the parent option which was already checked) then all my problems with Chripy 2.0's file aggregation and minification went away. Just clarifying this since the answer above could be interpreted to mean turning off notification altogether which is usually NOT a good idea.Biltong
C
11

In Visual Studio Pro 2012

There is an "Auto-Load changes, if saved" that works.

Tools > Options > Environment > Documents > Detect when a file is changed > Auto-Load changes, if saved

Cook answered 26/11, 2013 at 18:10 Comment(0)
T
9

Because a picture paints a thousand words...

enter image description here

Tolbutamide answered 10/3, 2015 at 23:54 Comment(0)
U
4

I generate source files on every build, and I don't (normally) get a "file has been modified" message if the file is not open in the editor.

I was getting it just now, however, on a closed file. (That's why I went searching for this question.)

I think that's a bug. The file seems to get wedged sometimes. (But this is the first time it has happened in about a year.)

I think I've found a work-around just now: Open the offending file and then close it again.

The point is, you shouldn't need to turn off changed file detection.

Urania answered 20/5, 2010 at 4:40 Comment(2)
In my opinion, this is the correct answer. I'm using Chirpy 2.0 to generate minified version of files, and everything was working fine until today. Suddenly, VS-2010 was protesting whenever I saved any changes that were propagated to the generated & minified file. I was getting the warning even though file wasn't loaded. At first I thought it was due to the ASP.NET development port running in the background, so I killed that. Didn't help. Then I restarted VS-2010. Didn't help, either. SO I LOADED AND THEN CLOSED THE OFFENDING FILES. That worked. Probably a problem w/ persisted user settings.Biltong
Actually, I take this back. Reload only solve the problem temporarily. The problem re-appeared shortly after opening and closing the offending files. So this doesn't seem like a real solution. However, there's an additional checkbox below "Detect when a file is changed outside the environment" called "Auto-load changes, if saved" Checking that box has solved all of my problems without the need to turn off notifications.Biltong
K
0

This is an old post, but what worked for me was slightly different and I wanted to share:

This file has been modified outside the source

Go to Tools -> Options -> Debugging -> General and uncheck "Require source files to exactly match the original version". This allows you to use source code which is not the same as original version.

Kreis answered 5/6, 2020 at 0:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.