Visual Studio closes documents after running

♀尐吖头ヾ 提交于 2019-12-11 03:18:08

问题


Not sure if this is Parallels related, but I'm running Visual Studio 2013, and one day I my documents started closing after debugging a .NET project. The expected behavior is that all the files that are open would stay open, but now they all close. Even after closing the program that's debugging, if I try to open a document to view the code, a new tab does not open because VS thinks the file is still "open."

One fix is to go to Window > Close All Documents which closes the files that were open in the background and lets me open the documents while the program is debugging or not debugging. Window > Reset Window Layout wreaks havoc in Parallels, opening tons of other panels like Watch 1, Watch 2, Memory 1, etc.

All I want is to keep files open so I can set breakpoints, or whatever a dev does with a file that's open! What defaults or setting needs to be reset to keep all the windows open during a run?


回答1:


Well, after a couple months of "just getting by" with this bug, I finally dedicated some time of my own to fix it. Ultimately the solution was to delete the user settings. However, even that brought out some strange issues with my environment.

CAUTION - This will revert your VS back to first use settings

Here are the steps:

1) Delete everything in this folder: C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio (if you don't see AppData folder, you need to show hidden folders -- In Windows Explorer: Organize\Folder and search options\View and select Show hidden files, folders and drives.)

2) Delete everything in this folder: C:\Users\%USERNAME%\AppData\Local\Microsoft\VSCommon

3) Run a command prompt here: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE by navigating to that folder then hold Shift+rightclick and select "Open Command Prompt Here"

4) run: "devenv /ResetUserData" (following this SO post if needed - How do I truly reset every setting in Visual Studio 2012?)

I have a bunch of Git repos set up and all I had to do was open the .sln in the newly reset VS and it automatically added the repo, which was a plus if you thought that would all need to be readded. Some cases may require a user to delete everything in this folder C:\Users\%USERNAME%\AppData\Local\Microsoft\Team Foundation if you're having issues with scm that's not Git based, and I actually did delete everything in there even though I probably didn't need to in my case.

NOTE: During this process, I found out that I had three folders C:\Program Files (x86); Microsoft Visual Studio 10.0, Microsoft Visual Studio 11.0, Microsoft Visual Studio 12.0. When I ran devenv in the 10.0 folder, it worked, but in 11 and 12, it didn't. There were a ton of folders and .exe that weren't in the 11 and 12 folders, like devenv.exe, causing a "'devenv' is not recognized as an internal or external command, operable program or batch file." I actually had to go into the Control Panel > Add Remove Programs to "Change" my VS install. I just ran a quick "Modify" by selecting something that wasn't installed and all the folders showed up in the 12.0 folder, so the command would work.

I'm just glad I didn't have to uninstall and reinstall VS.



来源:https://stackoverflow.com/questions/28975581/visual-studio-closes-documents-after-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!