Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off Visual Studio 2015 Roslyn error highlighting?

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.

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

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.

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

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

EDIT

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

like image 249
Rosdi Kasim Avatar asked Feb 09 '23 14:02

Rosdi Kasim


1 Answers

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

Visual Studio 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.

like image 54
John Koerner Avatar answered Mar 15 '23 05:03

John Koerner