Skip to main content
Became Hot Network Question
Post Reopened by mmathis, JacquesB, Martin Maat
Align title with the question asked in the body, which is answerable and on-topic for this site
Added to review
Source Link
mmathis
  • 5.6k
  • 26
  • 35

Why Does Visual Studio Automatically Makewould you have a New Namespacedifferent namespace for Each Foldereach folder in a C# Projectproject?

I can't see how thishaving a namespace for each folder makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, says:

❌ DO NOT give the same name to types in namespaces within a single application model. For example, do not add a type named Page to the System.Web.UI.Adapters namespace, because the System.Web.UI namespace already contains a type named Page.

If you're going to follow that recommendation, what is even the point of having more than once namespace per project? Let alone having a new namespace for every folder in a project?

Why Does Visual Studio Automatically Make a New Namespace for Each Folder in a C# Project?

I can't see how this makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, says:

❌ DO NOT give the same name to types in namespaces within a single application model. For example, do not add a type named Page to the System.Web.UI.Adapters namespace, because the System.Web.UI namespace already contains a type named Page.

If you're going to follow that recommendation, what is even the point of having more than once namespace per project? Let alone having a new namespace for every folder in a project?

Why would you have a different namespace for each folder in a C# project?

I can't see how having a namespace for each folder makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, says:

❌ DO NOT give the same name to types in namespaces within a single application model. For example, do not add a type named Page to the System.Web.UI.Adapters namespace, because the System.Web.UI namespace already contains a type named Page.

If you're going to follow that recommendation, what is even the point of having more than once namespace per project? Let alone having a new namespace for every folder in a project?

Post Closed as "Opinion-based" by Greg Burghardt, gnat, Doc Brown
Source Link

Why Does Visual Studio Automatically Make a New Namespace for Each Folder in a C# Project?

I can't see how this makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, says:

❌ DO NOT give the same name to types in namespaces within a single application model. For example, do not add a type named Page to the System.Web.UI.Adapters namespace, because the System.Web.UI namespace already contains a type named Page.

If you're going to follow that recommendation, what is even the point of having more than once namespace per project? Let alone having a new namespace for every folder in a project?