|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Determining assembly from namespaceHi,
I know that in .NET an assembly can host several namespaces, or a namespace can be spread across several assemblies. However, is there a way to determine which assembly uses a specific namespace? For instance, how would you find out which assembly has hte System.Collections namespace? Thanks, >However, is there a Not in general, no. Any assembly on the system can add types to a>way to determine which assembly uses a specific namespace? For >instance, how would you find out which assembly has hte >System.Collections namespace? namespace so you would have to load every assembly available to find out. Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. You said yourself why you can't do it .. a namespace can be spread accross
several assemblies. There would be nothing to resolve back to (unless you built a full map) Show quote "Ludwig Wittgenstein" <sender_***@hotmail.com> wrote in message news:1148847222.987111.46240@u72g2000cwu.googlegroups.com... > Hi, > I know that in .NET an assembly can host several namespaces, or a > namespace can be spread across several assemblies. However, is there a > way to determine which assembly uses a specific namespace? For > instance, how would you find out which assembly has hte > System.Collections namespace? > > > > Thanks, > Ludwig,
Are you asking programmatically or as you are coding? As the others state programmatically you really cannot per se. You could iterate all the loaded assemblies, then iterate all the types in an assembly, looking for the desired namespace... While coding I normally use either the object browser or MSDN to find out what assembly or assemblies are needed for a specific type in a specific namespace. As you pointed out a namespace could be in multiple assemblies... -- Show quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Ludwig Wittgenstein" <sender_***@hotmail.com> wrote in message news:1148847222.987111.46240@u72g2000cwu.googlegroups.com... | Hi, | I know that in .NET an assembly can host several namespaces, or a | namespace can be spread across several assemblies. However, is there a | way to determine which assembly uses a specific namespace? For | instance, how would you find out which assembly has hte | System.Collections namespace? | | | | Thanks, | |
|||||||||||||||||||||||