If you create a new project in a solution that uses file-scoped namespaces the classes created by the project template should also use file-scoped namespaces.
Similar to #3930, which only handled new item templates (which work fine).
Repro steps:
- Create a new repository/solution with an EditorConfig file. Make sure the EditorConfig file contains
csharp_style_namespace_declarations = file_scoped:suggestion.
- Create a new project that contains at least one class with a namespace (e.g. class library or WPF application).
- See that the namespace in the generated class file uses the old block scoped style and that IDE0161 "Convert to file-scoped namespace" is triggered immediately.
Tested with Visual Studio 2022 17.0.6
If you create a new project in a solution that uses file-scoped namespaces the classes created by the project template should also use file-scoped namespaces.
Similar to #3930, which only handled new item templates (which work fine).
Repro steps:
csharp_style_namespace_declarations = file_scoped:suggestion.Tested with Visual Studio 2022 17.0.6