Namespace or Assembly?

后端 未结 9 723
长发绾君心
长发绾君心 2020-12-12 14:20

I am getting very confused between Namespaces and Assemblies. Are System.Data and System.Web Namespaces or Assemblies?

I have noticed these

9条回答
  •  感情败类
    2020-12-12 14:47

    Namespace is a logical grouping of classes belongs to same functionality. So System.Web and System.Data are namespaces

    MSDN describe it as:

    Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes Secondly, declaring your own namespaces can help control the scope of class and method names in larger programming projects.

    namespace

    Assembly is chunk of (precompiled) code that can be executed by the .NET runtime environment. It contains one or more than one Namespaces. A .NET program consists of one or more assemblies.

    System.Web.dll and System.Data.dll are assemblies.

    MSDN describe it as:

    Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.

    assembly

提交回复
热议问题