Visual Studio表现异常.我该如何解决? [英] Visual Studio is acting weird. How do I fix this?

查看:91
本文介绍了Visual Studio表现异常.我该如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前安装的Visual Studio很好,但是最近开始表现怪异.一些症状包括

My installation of Visual Studio was fine previously, but has started acting weird lately. Some of the symptoms include

  • Visual Studio随机挂起或崩溃
  • Visual Studio无法启动
  • 智能感知有时会消失
  • 插件不起作用,或无法启动
  • 我无法安装或卸载工具
  • 我无法再连接到源代码控制
  • 某些已知的良好项目类型无法正确加载
  • 已知文件类型不再突出显示语法
  • 我无法将文件添加到解决方案中,因为该选项显示为灰色
  • 由于错误,我无法向解决方案添加,删除或更新文件
  • 由于错误,我无法在解决方案中添加或删除项目
  • 由于错误我无法打开解决方案
  • 调试器无法启动或附加到进程
  • 尝试添加新项目时找不到任何模板
  • 由于错误我无法复制/粘贴
  • Visual Studio所需的DLL丢失或损坏
  • 菜单突然变空
  • 我知道应该可以正常工作的东西,现在不起作用
  • Visual Studio randomly hangs or crashes
  • Visual Studio won't start
  • Intellisense disappears sometimes
  • Plugins are not working, or are failing to start
  • I can't install or uninstall tools
  • I can't connect to source control anymore
  • Certain known good project types fail to load properly
  • Known file types don't have syntax highlighting anymore
  • I can't add files to a solution because the option is greyed out
  • I can't add, remove, or update files to a solution due to an error
  • I can't add or remove projects to a solution due to an error
  • I can't open a solution due to an error
  • The debugger cannot launch, or attach to processes
  • I can't find any templates when I try to add a new item
  • I can't copy/paste due to an error
  • A DLL required by Visual Studio is missing or corrupt
  • Menus are suddenly empty
  • Something that I know should normally work, now does not work

我该如何解决?

(对于这些类型的问题,该问题应被视为规范的骗子)

推荐答案

Visual Studio非常可靠,我们大多数使用它的人都没有遇到问题.但是,这是一个相当大而复杂的组件套件,这意味着问题肯定会发生.

Visual Studio is pretty reliable, and most of us using it aren't experiencing the issues you are. It's a pretty large and complex suite of components, though, which means problems are bound to occur.

大多数小问题已通过重新启动Visual Studio得以解决.某些涉及连接或服务的问题可以通过重新启动计算机来解决.

The majority of small issues are fixed by restarting Visual Studio. Some of the ones involving connectivity or services can be fixed by restarting your computer.

无法保证特定的Visual Studio安装不会发生不良情况.大型复杂应用程序配置错误或损坏的方式千差万别.

There's no way to guarantee that something bad won't happen to a particular installation of Visual Studio. The ways a large, complex application can become misconfigured or damaged are too varied to mention.

诊断和跟踪每个可能的原因所付出的努力是巨大的.没有人有时间这样做.一个可靠的解决方案-几乎在每次尝试时都有效-是:

The effort it would take to diagnose and track down every possible cause is great. Ain't nobody got time for that. The one reliable solution—which works almost every time it's tried—is:

继续,休息一下.当您对这个可悲的事实感到满意时,请回来.

Go ahead, rest your eyes for a little bit. Come back when you've come to terms with this sad fact.

辞职了吗?好的.我们将首先解决影响最小的问题,但可能最不可能起作用的步骤,以解决您的问题.在尝试解决此问题时,请保持注释!或将其写下来.如果到达最后一步,则将需要它们.

Resigned? Okay. We're going to go through the steps to fix your problem, starting with the lowest impact, but probably least likely to work, one first. While you are attempting to fix this, keep notes! Mentally, or write them down. If you get to the last step, you'll need them.

首先,让我们走最简单的路线,将Visual Studio返回其原始状态.为此,我们可以删除所有扩展名,并重置所有设置.

First, let's go the easiest route and return Visual Studio to its original state. We can do this by removing all extensions and by resetting all settings.

打开扩展和更新"对话框.如果找不到,请将其键入快速启动.如果找不到那个,请尝试ctrl-q.对于每个已安装的扩展,突出显示它,然后单击卸载"按钮.

Open the "Extensions and Updates" dialog. If you can't find it, type that into the quick launch. If you can't find that, try ctrl-q. For each installed extension, highlight it and click the Uninstall button.

接下来,让我们重置这些设置.确保先导出它们!

Next, let's reset those settings. Make sure you export them first!

从文档中:

导出设置
1.在菜单栏上,依次选择工具",导入和导出设置".选择导出所选环境设置"选项按钮,然后 选择下一步按钮.
2.确保选中要导出的设置类型的复选框,并清除所有其他复选框,然后 然后选择下一步按钮.
3.(可选)为您的设置文件命名,输入一个保存路径,或同时输入两者.默认情况下,设置文件的名称为 Currentsettings.vssettings并保存到%USERPROFILE%\ Documents \ Visual Studio 2015 \设置.
4.选择完成按钮.

To export your settings
1. On the menu bar, choose Tools, Import and Export Settings. Choose the Export selected environment settings option button, and then choose the Next button.
2. Make sure that the check boxes for the kinds of settings that you want to export are selected and all other check boxes are cleared, and then choose the Next button.
3. (Optional) Name your settings file, enter a different path where it should be saved, or both. By default, setting files are named Currentsettings.vssettings and saved to %USERPROFILE%\Documents\Visual Studio 2015\Settings.
4. Choose the Finish button.

您以后可以从同一位置导入它们.现在,保存设置后,请返回并重置它们.

You can import them later from the same location. Now, once you've saved your settings, go back and reset them.

工具->导入和导出设置...->重置所有设置

Tools -> Import and Export Settings... -> Reset all settings

已重设所有内容,请尝试重现您的问题.还在打破吗?

Having reset everything, try to repro your issue. Still breaking?

哎呀.

毫无疑问,您需要重新安装.让我们走最简单的路线,并进行修复.请执行以下操作:

There's no doubt that you need to reinstall. Let's go the easiest route and do a repair. Do the following:

  1. 转到控制面板>程序>程序和功能
  2. 选择Microsoft Visual Studio [任何版本] [任何年份]
  3. 点击更改"
  4. 点击修复"

完成此操作后,尝试重现您的问题.还是会发生吗?

After you've done this, try to repro your issue. Did it still happen?

Damnit,对不起.

Damnit, sorry.

如果您想尝试其他方法,则可以进行覆盖"重新安装.只需直接运行安装程序,然后选择安装"(如果您可以使用此选项).您可以使用原始媒体,但强烈建议您重新下载安装程序.这将在旧版本上覆盖新版本,而不会影响您的设置.重新安装后,请尝试重新安装.是吗?

If you want to try a different way, you may be able to do an "overlay" reinstall. Simply run the installer directly and select "install" (if this option is available to you). You can use your original media, but I'd strongly suggest you re-download the installer. This will overlay a new version over the old, without messing up your settings. After reinstalling, try to repro. Did it?

哎呀.我们走了.

您需要尝试卸载/重新安装.不过,首先,您可能要导出设置.您应该已经针对此答案的第一步执行了此操作,但是如果没有,请返回并按照说明进行操作.

You need to try uninstalling/reinstalling. First, though, you might want to export your settings. You should have done this for step one of this answer, but if you didn't, go back and follow the instructions to do it now.

保存它们后,重复步骤1和2(根据维修说明),这次选择卸载",而不是更改".如果您的问题与外部组件有关,请在其他已安装的应用程序列表中搜索它,然后也将其卸载.如果您偏执,请卸载与Visual Studio相关的所有内容.他们可能出去消灭你.

After saving them, repeat steps 1 and 2 (from the repair instructions) and this time select "Uninstall" instead of "Change". If your issue has to do with an external component, search for it in the list of other installed applications and uninstall it as well. If you're paranoid, uninstall everything Visual Studio related. They may be out to destroy you.

现在,重新安装Visual Studio.如果此时您已发现自己,那么您已经深陷其中,因此不要冒险从原始媒体进行安装.从您最初获得的地方下载一个全新的,完全更新的副本.例如,如果您通过MSDN订阅获得了Visual Studio,请去那里下载ISO.

Now, reinstall Visual Studio. If you've found yourself at this point, you're in deep, so don't risk installing from your original media. Download a fresh, fully updated copy from where you originally got it. For example, if you got Visual Studio via your MSDN subscription, go there and download the ISO.

现在,重新安装所有内容后,请尝试重新制作.又发生了吗?

Now, having reinstalled everything, try to repro. Did it happen again?

F#@& ing s#!t.

F#@&ing s#!t.

现在是时候创建一个错误报告了.转到连接

Now is the time to create a bug report. Go to Connect

https://connect.microsoft.com/VisualStudio/feedback/LoadSubmitFeedbackForm

提供尽可能多的信息.您需要在表单中向他们提供他们要求的所有信息,以及有关该错误,如何进行修复以及尝试并修复它的操作的详细信息.还记得我告诉你写下的那些笔记吗?现在把他们赶出去.我强烈建议您将您的问题标记为"公开",因为其他人可能会发现该问题并对其进行评论.

Provide as much information as possible. You need to give them all the info they ask for in the form, plus details about the bug, how to repro it, and what you did to try and fix it. Remember those notes I told you to write down? Bust them out now. I'd strongly recommend you mark your issue public, as it may be found and commented on by others with your problem.

您将在一天之内得到答复.他们可能会希望您打开Visual Studio日志记录并重现该问题.我不会在这里告诉您如何执行此操作,因为它们会为您提供有关所运行的Visual Studio版本的确切说明.关注他们并尽快回复.

Within a day you'll get a response. They will probably want you to turn on Visual Studio logging and repro the issue. I won't tell you how to do this here, as they will give you exact instructions for the version of Visual Studio you are running. Follow them and reply as soon as you can.

此过程将产生三个结果之一:

There will be one of three outcomes from this process:

  1. 他们会告诉您您做错了
  2. 他们会发现造成此问题的外部演员
  3. 他们会发现一个错误

对于#1,停止这样做,就完成了.对于#2,他们可能会告诉您卸载错误的actor(例如,删除插件),然后告诉负责此错误的人员(不要懈怠,做到这一点).对于#3,他们将对该错误进行分类,并将在以后的某个时间修复.如果这是一个真正的错误,他们很可能会建议解决方法,至少可以使您重新振作起来.

For #1, stop doing that, and you're done. For #2, they'll probably tell you to uninstall the bad actor (e.g., remove a plugin) and go tell the people responsible about the bug (don't slack--do it). For #3, they'll triage the bug and it will be fixed sometime later. It's likely they will suggest workarounds that will at least get you moving again, if it's a true bug.

就是这样.现在,继续并重新安装Visual Studio!

And that's it. Now, go forth and reinstall Visual Studio!

这篇关于Visual Studio表现异常.我该如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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