如何关闭 Visual Studio 2015 Roslyn 错误突出显示? [英] How to turn off Visual Studio 2015 Roslyn error highlighting?

查看:50
本文介绍了如何关闭 Visual Studio 2015 Roslyn 错误突出显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 Resharper,我们可以有选择地打开/关闭它,但我找不到关闭内置 Visual Studio 2015 代码亮点/建议的方法.

For Resharper we can selectively turn it on/off, but I could not find a way to turn off the built-in Visual Studio 2015 code highlights/suggestions.

我想这样做的原因是因为我有很多左连接 linq,而这些查询搞砸了 Visual Studio.

The reason I want to do this is because I have quite a few left-join linqs and these queries messed up Visual Studio.

我在 linq 上看到很多波浪线,我更喜欢关闭它们.

I am seeing lots of squiggles on my linqs and I prefer to turn them off.

这是我正在谈论的错误之一......我不知道如何摆脱它.

Here is one of the error I am talking about.. I have no idea how to get rid of it.

表达式的结果始终为true",因为int"类型的值永远不会等于int"类型的null"?

The result of the expression is always 'true' since a value of type 'int' is never equal to 'null' of type 'int?'

编辑

我从 ScottGu 的博客中找到了解决此问题的方法:C# ??null 合并运算符(并与 LINQ 一起使用)

I have found a way to fix this from ScottGu's blog here: The C# ?? null coalescing operator (and using it with LINQ)

推荐答案

如果您在谈论代码分析规则.然后在项目引用下,有一个分析器节点.

If you are talking about the Code Analysis rules. Then under the project references, there is an analyzers node.

如果您右键单击并选择打开活动规则集",那么您可以关闭任何您不想要的分析器.

If you right click and select "Open Active Rule Set", then you can turn off any of the analyzers you don't want.

这篇关于如何关闭 Visual Studio 2015 Roslyn 错误突出显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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