Assemblies vs Class Libraries (.NET)

前端 未结 4 769
死守一世寂寞
死守一世寂寞 2021-01-05 15:35

Could anyone point out the advantage of using assemblies, in the \'context\' of ASP.NET.

As I understand it, assemblies run as executables, have a single entry point

4条回答
  •  离开以前
    2021-01-05 16:07

    Assemblies are not always executables. Most of people will define them as a collection of class modules presented as a single DLL or EXE file. The closest thing to them are the Java JARs.

    They have metadata (see http://en.wikipedia.org/wiki/.NET_metadata) which contains a bunch of information such as

    • version
    • methods and types

    They also have a manifest which is part of this metadata (see http://msdn.microsoft.com/en-us/library/1w45z383.aspx).

    You can register assemblies into the Global Assembly Cache (GAC) (see http://en.wikipedia.org/wiki/Global_Assembly_Cache), and you will make them available to all the other programs on the machine. (when in Visual Studio, you use "Add references", and browse the .Net tab, you are watching a list of assemblies in the GAC).

    You do not have to add them in the GAC, you can directly reference a private assembly, but registering them in the GAC make them globally available on the computer.

    This link contains sensible information about assemblies:

    • http://www.akadia.com/services/dotnet_assemblies.html#Assemblies

提交回复
热议问题