visual studio not remembering open documents & startup project
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:
- the start-up project reverts to a different one than was selected when I last clos开发者_高级运维ed
- my project heirarchy is not what it was when it closed - every project is expanded
- 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,
BerrylI believe this information all lives in your .suo
file and/or .user
file. If they've become corrupt, VS will struggle, so it'll revert to the default.
Maybe try exiting VS, deleting the .suo
and/or .user
files, start VS and set it up how you want, restart it again and see if it remembered the settings.
I ran into this problem in Visual Studio 2015. Removing the .suo file in the solution root did not fix the problem. I needed to remove everything under the following directory:
\\SolutionRootFolder\.vs\FolderWithSolutionName\v14\
.vs is a hidden folder and .suo is a hidden file under the v14 folder that must be deleted along with the vbcs.cache folder.
Update for VS2017: The problem still exists in VS2017 with the v15 folder.
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
In Visual studio 2015 :
Tools -> Import and Export Settings -> Reset all settings
It worked for me.
Happy coding :)
I had the same problem and tried removing the .suo file. However, that did not fix the project. I then tried the 'reset' option which worked perfectly.
I had the same problem with Visual C# express.
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 looks like a VS bug since Express versions don't support any plug-ins anyway. I noticed that after I would delete the .suo file and reopen visual studio it would generate a new .suo file for that particular solution which would normally be around 57k. If I would open any file in the environment and then close visual studio (even if that file was not part of the solution at all) it would save a .suo which was around 916k. After that, opening that same solution would cause the problem described above.
In Visual Studio 2015 >> Tools > Options > Enviroment > Startup > At startup > Load last loaded solution
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.
I solved this problem in Visual Studio 2010 Professional by invoke main menu command "Windows->Reset Window Layout"
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:
- Tools -> Import and Export Settings...
- Select "Export Selected Settings" -> Next. Check all checkboxes.
- Expand "General Settings"
- [Important] Uncheck "Window Layouts". -> Next -> Finish.
- Back to: Tools -> Import and Export Settings...
- Reset all settings -> Next -> just reset all settings.
- 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
In Visual Studio 2017 the Tools -> Import and Export Settings -> Reset all settings worked perfectly for me.
Erasing the .suo file did not...
Even I solved this problem in Visual Studio 2015 Professional go to "Windows->Reset Window Layout" First i tried deleting .user/.suo file, but it was not wark out for me .Last i got solution like above.
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
精彩评论