Use
Assembly.GetTypes();
This will get you a collection of all types and then you can get the Namespace property for each of them.
Then I guess you can simply check that all the types have same Namespace value and use this value. Otherwise add some other logic to detect what namespace to consider primary.