Where does Visual Studio store the watch window data? - visual-studio

I use to have some complex expressions in the watch window and out of a sudden the watch window is completely empty now. Of course I can put the expressions back manually but it would be really interesting to know where Visual Studio stores the watch window data? I doubt that it's stored in some solution related file since after a clean build the watches are still there.
I am using Visual Studio 2013 on Windows 10.

Watch window information is stored in the .suo file for the solution. I couldnt find it in any of the official documentation for, but the breakpoints are there and if you configure the watch window, then close VS, then delete the .suo file and open VS the watch window is empty. After closing VS, restoring the .suo file and opening VS again the watch window configuration is back. This is confirmed for instance by this blog post:
What informations are saved in my .suo file
This file is used by Visual Studio to store user/solution specific
information such as Opened Files, Expanded Nodes in the Solution
Visual Studio .suo fileExplorer, Opened Tool Windows and its
Positions, User Tasks, Breakpoints, Start-up Project, Contents of
Watch window, Whether the project is loaded/unloaded etc. The same
file is used by Visual Studio Addins (VSPackages) to persist
information that are specific to that solution/user.
I don't know where your .suo file went though, did you accidentally delete it?

Related

Project scripts not saved in the Visual Studio list

When I edit the Unity scripts, it opens up visual studio for me, and I manage the code there. Each script opened in visual studio has an x ​​next to its name, so you can remove it from view.
When I don't press the x and leave the script open in visual studio, if I close visual studio and open another script from Unity, the last script selected is shown, and alongside the previous script that I had not deleted with the x (it shows me the previous scripts that I had opened and had not removed).
What I just said happens with 6 of my projects.
The seventh however (not in order), does not behave like this. When I open a script and, without deleting it (from view, not from Unity), I close visual studio, the next time I reopen, the recent scripts are not displayed. I would like them to be displayed.
This is because I have about thirty scripts in the project, and managing the openings from visual studio is much faster than doing it from Unity, as first you have to search for the exact path of the script, and then you must also wait for it to load.
I searched for solutions and tried looking at visual-studio / unity settings, but didn't understand what may be causing this.
I have done the "Reimport All"
I have regenerated the project files
I have reinstalled Unity and Visual Studio Community 2019 from the Unity Hub
There's a .sln file, which references .csproj files, which contain the files within your project. These files are those listed in your solution explorer. These files are generated by Unity and are related to Project files. In Visual Studio in the Solution Explorer, you will see the Solution (.sln file) which contains one or more projects (.csproj), and the files within a project.
Now besides of that, Visual Studio has a lot of settings besides the actual solution and project. These settings are for instance:
How you arrange your view in VisualStudio
Which tabs are opened (Your question refers to the file tabs)
These settings are stored within a .suo file. These .suo files are located within a hidden directory .vs inside your project folder (next to the .sln file). Usually the .suo files and the .vs folder are part of the .gitignore list so they don't get added to the repository, because they are machine specific settings. E.g. you want your VisualStudio to be set up differently than that of another developer in your project.
I think you need to make sure that your .suo files don't get overwritten/changed by any other mechanism. For instance, if the .suo file is added to a git repository, another developer closes all the tabs, and pushes it's .suo file, and you pull that. Then after you reopen Visual Studio all the tabs will be closed. If you open 5 tabs, and push your .suo file, and the other developer pulls it, next time that developer opens VS the 5 tabs will be opened.
You can also try to delete the .vs folder to reset everything. Don't forget to make a backup though.

Visual Studio 2012 automatically opens specific files on start

There are about 6 files that are automatically opened every time I launch Visual Studio 2012, even though they are already closed by me in the previous session. How can I make it so that those files no longer automatically open upon each launch, so I no longer have to manually close them?
Open documents and similar user options are stored in a .suo file in the same directory with your .sln file. If your specific .suo file became corrupted, you can try to manually delete it.
Just make sure close your files and "save your project" again. This should fix it.

Visual Studio 2010 - How to enable prompt to delete file from disk when removed from project?

In Visual Studio 2005, when you remove a file from a C++ project (by right-clicking in the Solution Explorer and selecting "Remove"), it asks you whether you just want to delete the reference, or also delete the file itself from disk.
In Visual Studio 2010, this prompt seems to have disappeared (or I have accidentally turned it off). This means that every time I delete a file in the Solution Explorer, I have to immediately hunt it down and delete it with Windows Explorer (otherwise I'll forget and it will stay around forever). How do I get the prompt back?
I found some documentation (http://msdn.microsoft.com/en-us/library/0ebzhwsk%28v=vs.100%29.aspx) explaining the difference between "Remove" and "Delete", and that "Delete" doesn't exist for C++ projects (but no reason is given). Maybe it's really just not possible? If so, what an annoying regression.
You get the remove or delete file dialog only if the selected file is stored in the project folder. If the file is stored outside of the project folder the file reference is removed without dialog.
This behaviour is still the same for e.g. VS2013. I created a user voice request to change this behaviour here. IMHO your file hierarchy should not make any difference.
You can vote for the change here:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9146353-remove-delete-dialog-should-show-up-when-deleting
Assuming one is using Sourcegear Vault as the source control system, you can enable the prompt by going to Tools -> Options -> Source Control -> Integration Options -> and check on "Show warning before deleting items from source control"

Visual Studio 2010 crashes on view properties

Somehow my Properties window has become detached. When I view properties of any item in the Solution Explorer, it pops up but then I get a message that Visual Studio has stopped unexpectedly.
I've gone through my solution and deleted all .user and .suo files, but it still happens. I've also tried the reset layout option and no luck.
There must be a docking information file somewhere that I could delete or edit.
How can this be solved?
They are usually stored in a .vssettings file. So you could find that and delete/rename it.
Try running this in the command line:
devenv.exe /resetuserdata

Visual studio 2010 stuck

I've opened a XAML file in VS2010 that crashes Visual Studio.
The problem is that when I close VS and reload it again the XAML file automatically opens and crashes my VS again.
I don't know how to solve this loop.
Is there a way to open the solution with all files closed?
You could delete your solution's '*.suo' file. This file contain the information about the open editors. If you delete it visual Studio will not open any editor when loading the solution.
However you might lose some other customizations as well but in general there is nothing really important in this file and Visual studio will automatically create a new .suo file
I will try even a more violent method.
Move it into trash, and then bring up Visual Studio 2010.
Open another file in Visual Studio so your XAML file opening record will be washed out by the new one.
Close Visual Studio, and then restore your XAML file.
I'm pretty sure that Microsoft's file system won't track where your XAML file go and then tell Visual Studio to open it in the new location, but putting it in trash temporally is a great option.
Try temporarily move the xaml file to another location. (or rename) so VS cant find it, then you should be able to open.

Resources