How to get rid of Naming rule violation messages in Visual Studio?

后端 未结 9 610
我在风中等你
我在风中等你 2020-12-14 05:10

I just installed Visual Studio 2017. When I open an existing website, I get all sorts of warning messages such as this one:

IDE1006 Naming rule violat

9条回答
  •  自闭症患者
    2020-12-14 06:00

    Its a new configurable feature, if you go to

    Options → Text Editor → Your language (I did C#) → Code Style → Naming

    In there I went to Manage Styles add camel Case (its in there but you need to add it to your selectable): go to the "+" sign, then add your rule accordingly.

    Important: Close your solution and re-open it for changes to take effect.

    For example, I only use camel Case for private methods. So I choose Private Method and required Style the new one I created "camel Case" and set it to Severity Suggestion (I also promoted it to the top).

    The built in are all "Suggestions" too so you can also just turn off Messages.

提交回复
热议问题