Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ide including path in namespace when at class creation
Message
General information
Forum:
ASP.NET
Category:
Visual Studio
Environment versions
Environment:
C# 5.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01603252
Message ID:
01603255
Views:
48
>Update : in VB it does not create such a namespace, which explains why I was not bothered. :)
>
>When I create a new class the ide generates a namespace that includes the path. For example, my project is D030, I created a folder duedates, then when I create a new class the IDE generates the namespace D030.duedates.
>
>Is that a "feature"? Can I change that behaviour?

Three options:

(a) Go with it. In practice it makes it easier to find files if their namespace matches the folder name (think a while about why you would want separate folders in the same namespace)

(b) If you don't fancy (a) then create the class in the parent folder and then drag it to the sub folder.

(c) If you use Resharper then there is a 'NameSpace Provider' option in the folder properties. If you set it to false then VS still puts the folder name in the namespace but Resharper fixes it with one click....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform