Hi,
My questions is: how do I get the root namespace of an assembly (loaded by Reflection) I hope this is a simple enough question... I do need it for accessing types within the assembly.
Thanks in advance,
Alex
Hi,
My questions is: how do I get the root namespace of an assembly (loaded by Reflection) I hope this is a simple enough question... I do need it for accessing types within the assembly.
Thanks in advance,
Alex
Root Namespace
TKent
It kind of appends the root in the class file in the namespace declaration itself. So, the developer has the option to still write the namespace as he wants it to be and override it. So whatever, is the content of the namespace declaration in the class is the final one.
Regards,
Vikram
StefanH07
It is always possible to override the namespace specified in the IDE by specifying a different one in the specific class.
The best option is to rely on the complete Type Name which you retrieve using the GetTypes() method on an assembly.
Regards,
Vikram
Solanice
Ok, thanks for your replies, all working now... What I did was use the GetTypes() function to get all the types within the assembly and when I found the type I wanted, I took the Namespace property and used that. It isn't the simplest way, but it works well for me. :)
Alex
Konstantin Kamanin
Andrew English
Onomatopoetikon
What did you plan on using the assembly's root namespace for
Best regards,
Johan Stenberg
MrTufty
Namespace Foo
Public Class Bar
End Class
End Namespace
Public Class Zoo
End Class
the compiled assembly would contain the two public classes MyCompany.Foo.Bar and MyCompany.Zoo
Best regards,
Johan Stenberg