3

In VS 2010, after I would close my solution, and then re-open it the next day, all the documents that I had open, would still be open. Just what I wanted.

After installing SP1, every time I open my solution, all my documents are closed, no matter what state I left them in.

Is this expected behavior, a bug, or is there a setting I don't know about? How can I get my documents back?

EDIT 29-Mar

Re-installing VS2010 and SP1 did not resolve this issue.

Stewbob
  • 16,759
  • 9
  • 63
  • 107

6 Answers6

4

Building on top of SteveBob's answer, just do a Window -> Reset Window Layout

This should fix the tab problem. There is of course the side-effect that you'll have to redo/re-add all the windows ( output, solution explorer, properties, find, watches, immediate, etc)

Yasir Laghari
  • 10,714
  • 4
  • 19
  • 17
  • 1
    I had the same problem with VS not remembering my open tabs. This fixed it for me. In my opinion, this should be the accepted answer, it is way easier and less disruptive. – John Myczek Jul 24 '14 at 18:12
3

Backup your settings then do a devenv.exe /resetsettings.

Luke Kim
  • 1,046
  • 10
  • 11
  • This suggestion was successful to a limited degree. It did restore the functionality of keeping my documents open that I wanted, but it wiped out all my (dozens and dozens) of other settings. +1 for now, but if you can tell me which setting was causing the problem, so I can just reset that one, I'll make sure you get the +100 bounty that was originally offered on this question. – Stewbob Apr 07 '11 at 12:38
  • Luke, you get the 'accept' for getting me pointed in the right direction. Thanks for your help. – Stewbob Apr 07 '11 at 14:08
  • [edit] just re-read your answer, looks like you figured it. [original]I don't know enough about how it stores that to tell you why that worked, sorry. But I would try exporting your new settings, then do a windiff against the two (they are xml) and you might be able to find out what went wrong. Also, you could try reimporting your originally backed up settings and seeing if that fixes it, as that would ensure everything is "set". – Luke Kim Apr 08 '11 at 04:32
2

It appears that there is not an adjustable setting that controls whether or not the open documents are remembered. By default, Visual Studio stores this data and then re-opens the documents that were open the last time the project/solution was closed. As pointed out by some links referenced by Stuart Dunkeld, it takes a Macro in Visual Studio to override this default behavior.

My problem appears to be that my 'Settings' had become bloated/corrupt. Based on the suggestion of Luke, I exported my settings, then did a reset. This restored the default 'Remember Open Documents' behavior. Then after much fooling around, I was able to import (almost) all of my old settings and still not mess up the proper document behavior.

When importing my settings, I selected everything except the 'Window Layouts' settings.

enter image description here

This restored my existing settings, while keeping the default Visual Studio behavior of remembering which documents were open.

I then re-exported my (fixed) settings so that I had a backup. That's when I noticed that my old, possibly corrupt exported settings file was 8.6MB, while my new, correct exported settings file was only 0.2MB.

After examining some of the differences between these two settings files, some of the information leads me to believe that the installation of VS2010 SP1 had a conflict with the 'Document Well 2010 Plus' feature in the Productivity Power Tools extension, but I cannot positively verify this.

Community
  • 1
  • 1
Stewbob
  • 16,759
  • 9
  • 63
  • 107
1

I keep a lot of files open. Every so often, my VS2012 stops restoring the open files. Opening them again does not help the restore process.

I tried:

  • All the above suggestions, and all the suggestions I could find elsewhere
  • In particular: deleting .suo, .filters, .sdf, .opensdf, etc
  • Plus /resetlayout
  • Plus /resetsettings(ouch)

And none work for me. Or, at least not reliably.

But I just tried:

  • Install Productivity Power Tools
  • Enable Options / Productivity Power Tools / All Extensions / Custom Document Well
  • Restart Visual Studio
  • (the PPTools document well saves and restores properly!)
  • Disable Options / Productivity Power Tools / All Extensions / Custom Document Well
  • Restart Visual Studio

And now the builtin document well has resumed saving and restoring properly as well! At least for the moment.

I'm guessing that the builtin "document well" was derived from the one in PPTools, possibly causing the side effect of turning the PPTools on and off.

(I could simply use the PPTools document well all the time. But I can't get the colors therein to work to my satisfaction.)

Hope this helps someone.

garryw
  • 21
  • 3
1

Does it work OK with a new solution? If so, you could try trashing the .suo file attached to your solution.

stuartd
  • 70,509
  • 14
  • 132
  • 163
  • Good suggestion, but no, it does not work with a new solution. – Stewbob Mar 17 '11 at 15:12
  • There are other people who have seen this - eg http://stackoverflow.com/questions/4350701/visual-studio-2010-express-no-longer-saves-open-tabs-when-closing-solution – stuartd Mar 17 '11 at 16:13
0

Have you tried deleting the .suo file? It may have become corrupted.

Jon
  • 428,835
  • 81
  • 738
  • 806