Change default namespace associated to a folder when creating new class
See original GitHub issueThis issue has a corresponding ticket on Developer Community. Please vote and comment there to make sure your voice is heard.
It would be nice if there is a feature to set a default namespace for each folder when creating a new class. For example, if we have the following file structure:
MyProject
MyFolder
MyClass1
Then if we create MyClass2
under MyFolder
, the created class will be under the MyProject
namespace instead of MyProject.MyFolder
.
Additional references: https://stackoverflow.com/questions/1317901/change-default-namespace-when-creating-class-in-folder-visual-studio
Issue Analytics
- State:
- Created 4 years ago
- Reactions:75
- Comments:37 (14 by maintainers)
Top Results From Across the Web
Change Default Namespace when creating Class in Folder ...
Right click on the project, go to properties and under the 'Application' tab there is a 'Default namespace' field. Note that this doesn't...
Read more >Sync namespace and folder name - Visual Studio (Windows)
Place your cursor in the namespace name. · Press Ctrl+. to trigger the Quick Actions and Refactorings menu. · Select Change namespace to...
Read more >Creating a class in a non-namespace provider folder will ...
Create a new folder (called 'Folder') in a C# solution. ... under the namespace name and suggests that I change it to 'DefaultNamespace'....
Read more >Adjust Namespaces | JetBrains Rider Documentation
This command is a bulk fix that helps you synchronize namespaces with folder structure in any scope, which can be as large as...
Read more >Adjust Namespaces | ReSharper Documentation
To assign a shortcut, go to Tools | Options | Environment | Keyboard and find the ReSharper_RefactoringsAdjustNamespaces command. This command ...
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
To paraphrase, the request is to be able to mark a folder with metadata to stop it from participating in namespace construction.
This is not flexible
Should be