using System; namespace Hierarchy1 { /// <summary> /// Summary description for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { // // TODO: Add code to start application here // } public void Test() { } } namespace Hierarchy2 { class Class2 { } } }However using namespace inside of your type definition will generate a CS1519 compiler error which makes sense if you think in terms of type and not methods.