What are .NET Assemblies?

What are .NET Assemblies? I browsed over the net and I am not able to understand the definition.


In more simple terms: A chunk of (precompiled) code that can be executed by the .NET runtime environment. A .NET program consists of one or more assemblies.


Assembly is the smallest unit of deployment of a .net application. It can be a dll or an exe .
There are mainly two types to it:

  • Private Assembly: The dll or exe which is sole property of one application only. It is generally stored in application root folder

  • Public/Shared assembly: It is a dll which can be used by multiple applications at a time. A shared assembly is stored in GAC ie Global Assembly Cache .

  • Sounds difficult? Naa....
    GAC is simply C:WindowsAssembly folder where you can find the public assemblies/dlls of all the softwares installed in your PC.

    There is also a third and least known type of an assembly: Satellite Assembly .
    A Satellite Assembly contains only static objects like images and other non-executable files required by the application.

    Hope this helps the readers!


    Assemblies

    When you compile an application, the MSIL code created is stored in an assembly . Assemblies include both executable application files that you can run directly from Windows without the need for any other programs (these have a .exe file extension), and libraries (which have a .dll extension) for use by other applications.

    In addition to containing MSIL, assemblies also include meta information (that is, information about the information contained in the assembly, also known as metadata ) and optional resources (additional data used by the MSIL, such as sound files and pictures). The meta information enables assemblies to be fully self - descriptive. You need no other information to use an assembly, meaning you avoid situations such as failing to add required data to the system registry and so on, which was often a problem when developing with other platforms.

    This means that deploying applications is often as simple as copying the files into a directory on a remote computer. Because no additional information is required on the target systems, you can just run an executable file from this directory and (assuming the .NET CLR is installed) you ' re good to go.

    Of course, you won ' t necessarily want to include everything required to run an application in one place. You might write some code that performs tasks required by multiple applications. In situations like that, it is often useful to place the reusable code in a place accessible to all applications. In the .NET Framework, this is the Global Assembly Cache (GAC) . Placing code in the GAC is simple — you just place the assembly containing the code in the directory containing this cache.

    链接地址: http://www.djcxy.com/p/37686.html

    上一篇: 警告:程序集绑定日志记录已关闭

    下一篇: 什么是.NET程序集?