gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 12:48:28 25 4
gpt4 key购买 nike

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

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

开发环境: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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com