How do I get the namespaces of an assembly and not of its dependencies?
For example, if I get the namespaces using
assembly.GetTypes().Select(t => t.Namespace).Where(n => n != null).Distinct()
would I not get the namespaces of the dependencies of that assembly as well?
How do I distinguish between the 2?
I am loading the assembly via Assembly.LoadFrom(path) and I understand that it automatically loads the assembly's dependencies. For the solution, do I have to load the assembly in a way that the dependencies are not loaded? If yes, how do I do that?
Also, I do not have any control over the Assembly creation, like adding an empty class etc.
EDIT: correcting an example