Reputation: 2552
I have created a new copy of a .net project following this steps:
All worked well, the project compiles and I can run it.
The problem is that each time I add a new file to the solution, it inherits the old namespace of the source project...
I have to rename the namespace each time I add a new cs file...
How can I fix the problem?
Thanks
Upvotes: 1
Views: 241
Reputation: 5306
In addition to pm_2's answer...
I had a project I renamed. (Visual Studio 2017) Every time I copied an existing .aspx page, the new page and code behind file would have the old namespace names. In addition to pm_2's solution I had to make these changes also...
Checking in project file..
AssemblyInfo.cs:
View Properties Window.Ctrl+W,P
Under your project...expand Properties.
AssemblyInfo.cs is here.
Check the name(s) of
[assembly: AssemblyTitle("ProjectName")] [assembly: AssemblyProduct("ProjectName")]
Upvotes: 1
Reputation: 16705
In the project properties, there is a default namespace box. It will use whatever is in this as the default.
Upvotes: 4