This quick snippet will give you all the types declared in all the assemblies loaded, filtered by namespace.
Listtypes = new List (); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly asm in assemblies) { IEnumerable asmTypes = from t in asm.GetTypes() where t.IsClass && (t.Namespace != null && t.Namespace.StartsWith(targetNamespace)) select t; types.AddRange(asmTypes); }
I actually got to this point because of the way NUnit wraps an assembly in another AppDomain.
The snippet need Linq so it’s for 3.5 or newer.
