-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not include folder name to namespace #45494
Comments
How I would like to see this implemented:
|
I would like this feature. I think all that is necessary is an option on the folder in the properties tab that turns it off (thus skipping this folder as a part of namspace naming). This would also be the default option for sub-folders of a folder with it off. |
Is there not an option to disable this at the project level? This is extraordinarily irritating for those of us that do not used folders as namespaces. |
I don't believe there is. This appears to represent a small minority position. We'll have to weigh the cost of doing this, versus everything else, versus the size of the ecosystem that benefits from it. |
Related: dotnet/project-system#5372 |
I would like to see this too, in smaller projects, it sometimes makes sense to organize files into folders, but use one namespace for all objects. |
example: Organizing models in a meaningful folder structure that does not participate in namespace naming but keeps them all in the Models namespace. |
I don't think this represent a small minority. JetBrains Rider provided an option for this in a much more sophisticated way. Frankly if I can afford it, I will ditch Visual Studio with no hesitation. All you need to do is to provide a boolean option in the Solution Explorer's Folder Properties, say |
@aLexiusxx this is on our backlog. So if you wanted to contribute the fix of "All you need to do is...", We would likely take it. Thanks! |
I've wanted this for 20 years. Maybe it'll happen after I retire. It has just never made sense for a namespace to be tightly coupled to a file's location in a filesystem. They have dick-all to do with one another. All I want is for a new file to always just have a single namespace that is specified in the .csproj file. That would solve it for 95% of us. |
Spoken like a true vet! I am vehemently opposed to close-sourced tech like Rider but it's "namespace-provider" folder option is AWESOME!!! |
This issue has been moved from a ticket on Developer Community.
When a new class is created under a folder, Visual studio automatically appends the folder name to the namespace. This is very difficult to catch in codereviews and in some common libraries changing this later becomes extremely hard.
Please provide an easy way to disable this in csproj.
Original Comments
Visual Studio Feedback System on 6/23/2020, 00:34 AM:
We have converted this feedback item from problem to idea. This change was done to better reflect the feedback's nature.
Visual Studio Feedback System on 6/24/2020, 02:55 AM:
Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.
The text was updated successfully, but these errors were encountered: