Reputation: 21188
Can an assemble have multiple namespaces or is composed of single namespace.
Upvotes: 8
Views: 3867
Reputation: 33914
An assembly can contain multiple namespaces, because it can contain multiple logical groupings of objects and methods. Most assemblies I've seen are a single namespace, just for clarity, but there's no reason a single assembly couldn't contain a dozen different namespaces.
Upvotes: 10
Reputation: 49179
The hierarchy is:
Assemblies
contain Resources
and Modules
.
Modules
contain Fields
,Methods
, and Types
.
Types
may be qualified by any arbitrary namespace, provided that it doesn't conflict with another existing Type
.
Assemblies can short circuit past the Module level directly to all Types contained in all Modules in the assembly (via GetType() or GetTypes()).
Upvotes: 2
Reputation: 11409
Please see the msdn article Understanding and Using Assemblies and Namespaces in .net, that should clear up what does assembly mean and what does namespace mean.
Upvotes: 1