visual studio not remembering open documents & startup project

Viewed 55266

For the past week, something has changed about my VS solution, and I havent found a setting to fix it yet.

When I close the solution and restart:

  1. the start-up project reverts to a different one than was selected when I last closed
  2. my project heirarchy is not what it was when it closed - every project is expanded
  3. the documents that were open when closed are all closed

In each case I want the solution to look just like it did when I closed it last.

How do I make that happen?

Cheers,
Berryl

19 Answers

This doesn't address the startup project issue, but checking the "Reopen documents on solution load" checkbox fixed the remembering open documents issue for me.

You can change that setting here:

Tools -> Options -> Projects and Solutions -> General -> Reopen documents on solution load

Not sure if that checkbox existed before I upgraded Visual Studio 2017 to version 15.8.3 or if it got reset somewhere along the way

For Visual Studio 2017, Tools->Import and Export Settings-Reset All Settings did it for me after trying all other solutions as proposed.

Tried all of the above. Nothing worked. What worked for me (VS2017) is just going to my repo folder, show hidden files, delete the .vs folder and restart VS.

Visual Studio 2015 Enterprise: As for many people in this thread, deleting the .suo file did not help, so I resorted to resetting all settings...which worked. I did not want to wipe out all of my settings, so I spent a bit of time to see which setting was causing it (note: still cannot find it in options).

So, to fix the issue while keeping most of your setting intact, follow these steps:

  1. Tools -> Import and Export Settings...
  2. Select "Export Selected Settings" -> Next. Check all checkboxes.
  3. Expand "General Settings"
  4. [Important] Uncheck "Window Layouts". -> Next -> Finish.
  5. Back to: Tools -> Import and Export Settings...
  6. Reset all settings -> Next -> just reset all settings.
  7. Now import the settings file you exported in Step 4

Now you will have retained almost all of your settings, and fixed the problem. All you have to do now is move your pallets around to what you like and you're done!

Delete the .vs (Hidden) folder from the solution path and reopen the Visual Studio. It happens when updating the Visual Studio.

For Visual Studio 2019 version 16.9.2, this problem occurs if you open a detached code window. Even if you close the detached code window before exiting Visual Studio, when VS restarts, no code windows are reopened.

This occurs regardless of whether you've deleted your "Solution User Options" (.suo) file or whether Tools->Options->Projects and Solutions->General: "Reopen documents on solution load" is checked.

It's slated to be fixed in version 16.10, hopefully.

Edit: The VS dev community source ticket below denotes this issue is fixed in VS 16.9.6 and 16.10 Preview 1: https://developercommunity2.visualstudio.com/t/Visual-Studio-not-restoring-prior-open-d/1317364

For Visual Studio 2017 v15 go to Tools -> Options -> Project and solutions and chech "Reopen documents on solution load".

So nothing here fixed it for me. I am in VS 2015. Everything was find until I moved everything over to Windows 10. I did a reinstall of VS and started it up. It asked me what basic settings I wanted and I choose General. None of the projects I migrated over would remember their open windows. Sucked.

I followed every single bit of advice here and nothing worked. Worse even on Windows 7 it was carrying over.

So I decided to purge my settings and reset. When I did I was prompted with a dialog box to choose which default collection of settings I wanted. I chose visual c# and that fixed the problem instantly.

The initial problem was caused by my choosing "General" settings....

I have not tried the other settings. YMMV.

The only way I found to solve the problem was to:

reset the settings (Tools -> Settings -> Reset) exit studio delete the old corrupted .suo files from the solutions affected.

it works for me

Just close VS and delete .suo file then reopen VS and try

Related