Define coding style settings in Visual Studio

You can define coding styles in your Visual Studio and choose to be warned or to produce a build error if your rules are violated in the code.

Open the options with Extras\Options\Text Editor\C#\Codeformat\Naming

  • Choose the specifications or create a new one, e.g. “Private or Internal Field”
  • Create a new style e.g. “underscores” with prefex “_” and mixed lower and upper case
  • Choose your severity

options