C# - Location of using statements

后端 未结 3 1073
逝去的感伤
逝去的感伤 2020-12-10 14:22

One thing I have noticed a lot of back and forth on is where using statements should be placed in a C# code file- whether its in the outermost scope or inside a namespace. I

3条回答
  •  难免孤独
    2020-12-10 15:06

    I'd never even seen/heard of this practice until I started using StyleCop and would get flagged by rule SA1200, which I now just disable. It's odd that the .cs files that Visual Studio creates as part of a new project violate this rule by placing the using directives at the very beginning of the file, outside of the namespace.

提交回复
热议问题