A C# class with a null namespace
- by Richard Ev
While going through some legacy code today I discovered that you can declare a C# class without placing it in a namespace (in this scenario I have an ASP.NET WebForms application and some of the web forms are not declared within any namespace).
A GetType() on such a class returns a type where the namespace property is set to null.
I did not know that this was allowed - can anyone suggest why it would be desirable to have a class that is not declared within a namespace?