1058 shaares
75 liens privés
75 liens privés
1 résultat
taggé
namespace
For Visual Studio 2022
Go to: Tools > Options > Text Editor > C# > Code Style
The 4th block down, "Code block preferences"
Change "Namespace declarations" from "Block scoped" to "File scoped"
For VS Code,
I have installed "C# Extensions" by JosKreativ
Once installed, go to: File > Preferences > Settings
In the "Search settings" textbox type "namespace"
You'll see the option (for me 3rd);
"Csharpextensions: Use File Scoped Namespace"
Check that checkbox and you're good to go.