什么是.NET程序集?我在网上浏览了一下,我不明白这个定义。


当前回答

MSDN给出了一个很好的解释:

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.

其他回答

维基百科说:

In the Microsoft .NET framework, an assembly is a partially compiled code library for use in deployment, versioning and security. There are two types: process assemblies (EXE) and library assemblies (DLL). A process assembly represents a process which will use classes defined in library assemblies. .NET assemblies contain code in CIL, which is usually generated from a CLI language, and then compiled into machine language at runtime by the CLR just-in-time compiler. An assembly can consist of one or more files. Code files are called modules. An assembly can contain more than one code module and since it is possible to use different languages to create code modules it is technically possible to use several different languages to create an assembly. Visual Studio however does not support using different languages in one assembly.

如果你真的浏览过,澄清你不理解的地方会有帮助

汇编是. net框架编程的基本部分。 它包含CLR在可移植可执行文件中执行MSIL(Microsoft中间语言)代码的代码,如果它没有关联的程序集清单,将不会执行。

在Microsoft.Net中,程序集是代码版本安全、部署和可重用性的最小单元。

它包含:

- Assembly Identity
- Manifest
- Metadata
- MSIL Code
- Security Information
- Assembly Header

在。net中,当我们编译源代码时,会在Visual Studio中生成程序集。程序集由清单和IL(中间语言)两部分组成。清单包含程序集元数据意味着程序集的版本要求、安全标识、组成程序集的所有文件的名称和散列。IL包含类、构造函数、主方法等信息。

看到这个:

在Microsoft .NET框架中,程序集是用于部署、版本控制和安全的部分编译代码库