Visual Studio 运行后关闭文档 [英] Visual Studio closes documents after running

查看:29
本文介绍了Visual Studio 运行后关闭文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定这是否与 Parallels 相关,但我正在运行 Visual Studio 2013,有一天我在调试 .NET 项目后开始关闭我的文档.预期的行为是所有打开的文件都将保持打开状态,但现在它们都关闭了.即使关闭正在调试的程序,如果我尝试打开文档查看代码,也不会打开新选项卡,因为 VS 认为该文件仍处于打开状态".

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."

一种解决方法是转到窗口>关闭所有文档,它会关闭在后台打开的文件,让我在程序调试或未调试时打开这些文档.窗口 > 重置窗口布局 在 Parallels 中造成严重破坏,打开大量其他面板,如 Watch 1、Watch 2、Memory 1 等.

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?

推荐答案

好吧,经过几个月的刚刚解决"这个错误后,我终于花了一些时间来修复它.最终的解决方案是删除用户设置.然而,即使这样也给我的环境带来了一些奇怪的问题.

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.

注意 - 这会将您的 VS 恢复为首次使用设置

步骤如下:

1) 删除此文件夹中的所有内容:C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio(如果没有看到 AppData 文件夹,则需要显示隐藏文件夹 -- 在 Windows 资源管理器中:Organize\文件夹和搜索选项\查看并选择显示隐藏的文件、文件夹和驱动器.)

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) 删除此文件夹中的所有内容:C:\Users\%USERNAME%\AppData\Local\Microsoft\VSCommon

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

3) 在此处运行命令提示符:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE,导航到该文件夹​​,然后按住 Shift+右键单击并选择在此处打开命令提示符"

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) 运行:devenv/ResetUserData"(如果需要,请遵循此 SO 帖子 - 如何真正重置 Visual Studio 2012 中的每个设置?)

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

我设置了一堆 Git 存储库,我所要做的就是在新重置的 VS 中打开 .sln,它会自动添加存储库,如果您认为所有这些都需要阅读,那就太好了.某些情况下可能需要用户删除此文件夹 C:\Users\%USERNAME%\AppData\Local\Microsoft\Team Foundation 中的所有内容,如果您遇到不是基于 Git 的 scm 问题,我实际上确实删除了那里的所有内容即使在我的情况下我可能不需要.

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.

注意:在这个过程中,我发现我有三个文件夹 C:\Program Files (x86);Microsoft Visual Studio 10.0、Microsoft Visual Studio 11.0、Microsoft Visual Studio 12.0.当我在 10.0 文件夹中运行 devenv 时,它可以工作,但在 11 和 12 中却没有.有大量文件夹和 .exe 不在 11 和 12 文件夹中,例如 devenv.exe,导致'devenv' 未被识别为内部或外部命令、可运行的程序或批处理文件."我实际上必须进入控制面板>添加删除程序来更改"我的VS安装.我只是通过选择未安装的内容快速修改",所有文件夹都显示在 12.0 文件夹中,因此该命令将起作用.

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.

我很高兴我不必卸载并重新安装 VS.

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

这篇关于Visual Studio 运行后关闭文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆