visual-studio Visual Studio 编辑器不再为错误加下划线
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/267843/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio Editor does not underline errors anymore
提问by Mats
My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
我的 Visual Studio (2008) 编辑器已停止为错误添加下划线(这条漂亮的波浪状红线)。我真的不知道什么时候,但它可能与 .Net Framework 3.5 SP 1 或 MVC Beta 的安装有关(我猜这不太可能)。此外,我是否出于评估目的安装和卸载了 CodeRush 和 Resharper(决定不保留其中任何一个)。
Does anyone know the problem and how to restore this functionality again?
有谁知道问题以及如何再次恢复此功能?
回答by sontek
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
你检查过Tools→ Options...→ Text Editor→ C#→ Advanced→Underline errors in the editor吗?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
我平时喜欢的插件乱搞后重置我的设置,因为他们往往惹设置:Tools→交通Import and Export Settings...→交通Reset all settings。
回答by SerG
About possible causes.
关于可能的原因。
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
对于 VS 2012 和 2013,如果您在不同机器上有多个 Visual Studio 实例绑定到一个“实时”帐户并在其中一台上安装了 ReSharper,它将禁用本机 IntelliSense 和错误下划线(用它自己的规则替换)这将通过您的帐户同步到另一台没有 ReSharper 的机器。
回答by Kulamani
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
这在 Visual Studio 中通常称为禁用 Squiggly 或波浪线。
How you will do in Visual studio 2013?
你将如何在 Visual Studio 2013 中完成?
TOOLS-> Options... -> Text Editor-> C/C++-> Advanced-> Disable Squiggles: True/False(Under IntelliSense) -> Press OK
工具->选项... ->文本编辑器-> C/C++->高级->禁用波浪线:真/假(在智能感知下) -> 按确定
回答by Magmus
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
我知道这是一个老问题,并有各种解决方案,但我以不同的方式解决了它。我正在使用 VS2017 在我的 C# 代码上使用 Unity3D,突然 VS 决定在我打字时停止下划线错误。但是,如果我关闭文件选项卡并重新打开,它会突然取消错误。
For example:
例如:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
应该明显地为那个孤独的“s”符号给出错误。但是,在我关闭并重新打开此文件选项卡之前,VS 不会给它下划线。
Solution: Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
解决方案:复制整个 Unity 项目文件夹(基本上就像一个常规的 VS 解决方案文件夹)并使用新文件夹,这个问题就消失了。
回答by user3578181
For visual studio 2017 act according to HeeJae's comments in:
对于 Visual Studio 2017,根据 HeeJae 的评论在:
i.e:
IE:
Hi. you are probably hitting a known issue. can you try this?
你好。您可能遇到了一个已知问题。你能试试这个吗?
1.Update to latest release If that doesn't solve it
1.更新到最新版本如果还不能解决
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
2.转到工具\选项\项目和解决方案\常规并取消选中“允许并行项目初始化”。
3.Close VS.
3.关闭VS。
4.Delete the “.vs” directory beside their solution file.
4.删除解决方案文件旁边的“.vs”目录。
5.Reopen VS.
5.重新打开VS。
..
..
thank you
谢谢
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
问题解决后,您可以重新启用“允许并行项目初始化”选项。
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
我尝试升级 VS、重置 VS 设置、清除 VS 缓存以及人们常规执行的所有操作,但没有人解决此问题!最后,提到的解决方案神奇地对我来说有效。
Good luck
祝你好运
回答by Pihu Mehra
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
从解决方案中再次卸载和加载相同的项目可以解决问题。只需右键单击该项目,然后单击“卸载项目”。卸载后,再次右键单击同一个项目,然后单击“重新加载项目”。错误突出显示将返回。
回答by user341599
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
我在 2017 年遇到了同样的问题。有一个“禁用智能感知”选项,请确保将其设置为 false。

