- 1

Why It is necessary to add namespace in this app?

in visual studio we can run program without namespace also? why?

13th Jul 2016, 3:01 PM
Ashraf Choudhary
Ashraf Choudhary - avatar
3 Antworten
+ 1
No you cannot however I am not sure it is about the reference stuff or IDE needs it only. But since the name of the program is also a namespace might be about the compiler.
13th Jul 2016, 10:53 PM
Máté Lencsés
Máté Lencsés - avatar
+ 1
It is just to keep an order in your code. when you are working in a solution with several projects, and for example two of them have a class called DatabaseAdmin, if you don't use the namespaces.you will have troubles because of the ambiguety. by default the name space is the same as your project, but you can order your classes in different namespaces. and later if you want to call another class from a different namespace you have to add a using with their name. Its somewhat like packages in Java. The only difference is that in Java is a must do and in c# is optional. hope to help. I'm still working in my English.
28th Jul 2016, 3:55 PM
Julio González
Julio González - avatar
- 3
enjoy
18th Jul 2016, 12:32 PM
Vinoth Kumar