Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set the default namespace of a project as it is created?

When creating a project in Visual Studio, the name you use for the project is used to:

  • Name the project file
  • Name the project folder
  • Generate the default namespace for the project

The first two values are somewhat related, so it makes sense to keep them the same from a convention point of view, however using the value for a namespace causes problems:

Either you make your project names into namespaces, leading to very long file paths (which often cause problems with MSBuild when they exceed the 248 length limit for windows, you get given a default namespace which doesn't follow normal naming conventions and then has to be changed with Find-and-Replace.

I've been working around this problem for 12 years now and it's not getting any more fun.

Is there some method for setting these values separately at the point you're setting up the project?

like image 925
Paul Turner Avatar asked Nov 03 '22 05:11

Paul Turner


1 Answers

There's no way to do it during project creation, but you can change default namespace right after from Project Properties | Application | Default namespace

like image 53
Jarek Kardas Avatar answered Nov 08 '22 06:11

Jarek Kardas