dotnet format and file-scoped namespaces
See original GitHub issueI’m running on: dotnet --version 6.0.100-rc.2.21505.57
My .editorconfig file contains:
# Namespaces
csharp_style_namespace_declarations = file_scoped
Running dotnet format style
does not convert namespaces to file-scoped single-line namespaces.
I’d thought this was supported already. If not, is it coming soon? If so, any idea what I’m doing wrong?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Dotnet Format and File Scoped Namespaces | Blog
The dotnet format tool is a great way to quickly apply formatting from your .editorconfig to your entire project or solution. It handles...
Read more >File scoped namespaces - C# feature specifications
This feature specification describes file scoped namespaces, where the entire contents of a file are included in a namespace declared at the ...
Read more >Use dotnet format to switch to file-scoped namespaces
I'm trying to use the dotnet format command to convert a large C# solution to leverage file-scoped namespaces.
Read more >Updating your project to use File Scoped Namespaces
The solution is to use Visual Studio or dotnet format to update your project to use File Scoped Namespaces. First, you need to...
Read more >Using File-Scoped Namespaces in .NET 6 | by Jamie Burns
As its name implies, a file-scoped namespace is a namespace that has the whole file as its scope. Let's look at an example....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s all working. I created a short YouTube video covering the necessary steps. Feel free to share if you think it’s helpful:
https://www.youtube.com/watch?v=xbq7fbg8UxA&ab_channel=NimblePros
Ah, that makes sense, thanks!