Search code examples
c#namingroslyn-code-analysis

C# 2022 IDE - not warning about code styles or variable naming?


New install of Visual Studio 2022 - NET 6 project.

In the past, the variables (in the pic below) would have little squiggles underneath them and when I hover the mouse over them a suggestion would pop up stating something similar to (names are not cased or capitalized correctly). It was like the IDE had a code analyzer (maybe an extension/addon) that constantly monitored coding styles.

After installing VS 2022 I cannot figure out how to make these types of suggestions appear. Can anyone help me with this?

enter image description here

Edit - Additional info

I think, maybe it's rule IDE1006 that I am trying to activate in the IDE

Also, in (Tools)(Options) I have these settings. But not a single notification about variable names that violate IDE1006

enter image description here

I can see all of these notifications too (pic below), so, I know with certainty the code is being analyzed (the analysis is just not pointing out (variable name) violations)

enter image description here


Solution

  • There is a setting for enabling and disabling specific style guidance selections.

    enter image description here

    You will need to navigate to Tools/Options/Text Editor/C#/Code Style/General