能否请您解释一下什么是程序集在C#或.NET?
程序集是编译后的输出你的code,通常是一个DLL,但是你的EXE也是一个组装。这是部署的最小单位为任何.NET项目。
组装通常包含.NET code在MSIL(微软中间语言),将被编译为本地code(即时编译 - 由刚刚在即时编译器编译)第一时间是给定的机器上执行。这编译code也将存储在装配和再利用在后续调用。
该组件还可以包含像图标,位图字符串表等资源。此外,大会还包含元数据的程序集清单 - 样的版本号,强名称,区域性,引用的程序集等信息。
在99%的情况下,一个组件相当于磁盘上的物理文件 - 一个多文件组件(一个程序集,分布在一个以上的文件)的情况下,似乎是一个相当奇怪的球优势的情况下这我从来没有在我的5年以上.NET开发中遇到的至今。
在一个多文件汇编仍然会有唯一一个集清单的DLL或EXE和MSIL code在多个netmodule文件。
Could you please explain what is an Assembly in C# or .NET?
解决方案
An assembly is the compiled output of your code, typically a DLL, but your EXE is also an assembly. It's the smallest unit of deployment for any .NET project.
The assembly typically contains .NET code in MSIL (Microsoft Intermediate language) that will be compiled to native code ("JITted" - compiled by the Just-In-Time compiler) the first time it is executed on a given machine. That compiled code will also be stored in the assembly and reused on subsequent calls.
The assembly can also contain resources like icons, bitmaps, string tables and so on. Furthermore, the assembly also contains metadata in the assembly manifest - information like version number, strong name, culture, referenced assemblies and so forth.
In 99% of your cases, one assembly equals a physical file on disk - the case of a multi-file assembly (one assembly, distributed across more than a single file) appears to be a rather odd-ball edge case which I've never encountered so far in my 5+ years of .NET development.
In a multifile assembly there would still be only one assembly manifest in a DLL or EXE and the MSIL code in multiple netmodule files.
更多推荐
究竟什么是装配在C#或.NET?
发布评论