Adding a rule to use file scoped namespaces in .editorconfig worked for me:
- create an
.editorconfigfile in the solution directory - add following line/content below (docs, code – IDE0161)
Example .editorconfig file content:
[*.cs]
csharp_style_namespace_declarations = file_scoped:warning
After that the preview changes dialog had an option to apply the fix to the whole project/solution:
