We're using VS 2010 and GIT. Occasionally, after a git pull, all open files will close--seems like this happens when new files are added to the project. I can't seem to find a related file that shouldn't be in version control. Has anyone else had this issue?
-
from this one: [link](http://stackoverflow.com/questions/16074/visual-studio-open-files-question) looks like `.suo` tracks the open files. looking now. . . – David Droddy Mar 31 '11 at 13:14
-
thanks to followup from @samHocevar and quick testing, this problem is as follows: When a `.csproj` file gets touched (not necessarily changed), all its opened files are closed and never reopened. – David Droddy Mar 31 '11 at 13:29
3 Answers
I figured out a solution to this. It's a little annoying but it works around the tedious task of re-opening all of your tabs/files in VS.
When you get the VS warning that the Project has been modified outside of VS it asks if you want to reload the project. Choose "Ignore."
Next, save all your work, close VS and reopen your solution or project. All the files/tabs you had open previously will be open again and the updates to the project file, obviously, will also be loaded.
Another caveat to this is you lose all your "Undo" potential in your open files.

- 53
- 10
-
Utterly rediculous, but I'm glad for something that retains the whole context of what I'm working on. – argyle May 04 '12 at 16:33
When a .vcproj
file gets touched (not necessarily changed), all its opened files are closed and never reopened. Might this be what you are experiencing?

- 11,853
- 5
- 49
- 68
-
I don't see a `.vcproj` file. are you referring to the `.csproj` file? I do believe it is related to the `.csproj` file. – David Droddy Mar 31 '11 at 13:11
-
Ah yes, `.vcproj`, `.vcxproj` or `.csproj`... the name depends the language, but they're pretty much the same. – sam hocevar Mar 31 '11 at 13:13
-
Then, yes, the problem seems to be related to any "touch" of the `.csproj` file. It would be most inconvenient to remove this from version control. Maybe move to a `projectName.csproj.template` file in version control instead of the actual file? – David Droddy Mar 31 '11 at 13:21
-
The `.csproj` should be in the VCS, yes. What you need is a workaround for VS closing all the tabs; I have never found one. – sam hocevar Mar 31 '11 at 13:29
Check out WorkspaceReloder. It's a visual studio add in that will keep your files open upon reloading. It's tremendously useful and will keep you from having to go through those ridiculous steps. Productivity++.

- 217
- 1
- 5
- 18