c# - 每个程序集一个命名空间?

标签 c# .net namespaces

每个程序集至少有一个命名空间是否是一般准则?

在什么情况下,多个程序集通常应该共享同一个命名空间?

开发环境:C# 和 .NET

最佳答案

来自 MSDN

程序集

An assembly is a collection of types and resources that forms a logical unit of functionality. All types in the .NET Framework must exist in assemblies; Each time you create a Microsoft Windows® Application, Windows Service, Class Library, or other application with Visual Basic .NET, you're building a single assembly. Each assembly is stored as an .exe or .dll file.

命名空间

Namespaces are not a replacement for assemblies, but a second organizational method that complements assemblies. Namespaces are a way of grouping type names and reducing the chance of name collisions. A namespace can contain both other namespaces and types. The full name of a type includes the combination of namespaces that contain that type.

关于c# - 每个程序集一个命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14017666/

相关文章:

c# - 了解接口(interface) V 类

c# - 创建一个非常简单的链表

c# - 使用List.Sort()时忽略空白

namespaces - Laravel 4 目标接口(interface)不可实例化

r - 有条件地修改父函数的行为

c# - 用于加载 RTMP 源的应用程序的视频播放器

c# - 有没有办法给局部变量设置 XML 注释?

.net - 3DES 的官方测试向量

.net - dotnet 中的命名空间命名约定

namespaces - 为什么 "using namespace System;"会导致缺少类型说明符?