I'm trying to use the dotnet format command to convert a large C# solution to leverage file-scoped namespaces.
I've tried annotating my preference for these in the solution's .editorconfig with both
# from https://www.meziantou.net/updating-your-project-to-use-file-scoped-namespaces.htm
csharp_style_namespace_declarations=file_scoped:suggestion
and
# from https://stackoverflow.com/questions/71652548/rider-editorconfig-file-scoped-namespaces-not-respected
csharp_namespace_body = file_scoped
However, when I run dotnet format My.sln
it makes some whitespace formatting fixes (e. g. removing trailing whitespace) but does not convert to file-scoped namespaces. Is this supposed to work? What am I missing?
I'm using dotnet
6.0.201 and I've also tried downloading an updated build of dotnet-format
(7.0.321101+ec7537dd0645b35fc9057006639ca41e37d16348).