Agenda Assembly Introduction. Types of Assembly. Strong Naming an Assembly. GAC (Global Assembly Cache).
Assembly Introduction DLL is the precompiled chunk of . NET which can be run by the CLR. They form the fundamental unit of deployment version control, reuse, activation scoping and security permissions. DLL is .NET term for a deployment and configuration unit. Files with extensions .EXE/.DLL are known as assembly. Assemblies include metadata(manifest and IL). Assemblies are the answer to the DLL hell problem. Assemblies can be classified as private and shared assemblies. Any .NET application -> compile->> Assembly (.exe or . dll ). We use ILDASM.exe (Intermediate language disassembler) to peak at the assembly manifest and IL and we can also used to export manifest and IL to text file. ILASM.exe (intermediate language assembler) to reconstruct an assembly from a text file that contains manifest and il .
Assembly Introduction Assembly .DLL .EXE -Compilation of class library -Supportive file. -Don’t use any Main method. -Can not execute dll file ,only compile it -Compilation of application. -It’s a application file. -Use Main Method. -can execute .
Types of Assembly Private Assembly Shared Assembly
Strong Naming an Assembly . NET assemblies can be broadly classified into two types 1.Weak Named Assemblies 2.Strong Named Assemblies. An Assembly name consist of 4 parts. 1.Simple textual name. 2. Version Number. 3. Culture Information. 4.Public key token. Assembly version attribute used to specify the Assembly version. The default is 1.0.0.0 The version number of an assembly consists of following 4 parts 1.Major Version 2. Minor Version 3.Build Number. 4.Revision Number.
Strong Naming an Assembly All .NET framework assemblies installed in GAC(global assemblies cache). C:\Windows\assembly folder is called GAC. Strong named assembly has public key token. Culture specify language of the assemblies . Strong naming key tool is used for generating public key tokens. s n.exe –k c:\MystrongKeys.snk used to create public key tokens(will discuss later). Strong named assembly should have all of the following The textual assembly name The assembly version number. The assembly should have been signed with private/public key pair.
GAC(Global Assembly Cache) GAC contains strong named assemblies . Assemblies in GAC can be shared by all applications running on that machine, without having copy the assembly locally. It is recommended to install an assembly into GAC , only when required and shared by applications , otherwise they should kept private. You should not add an assembly into GAC if you wish to deploy your application to another machine using Xcopy deployment. This is because in Xcopy deployment we only copy the application files to the target machine and not the GAC contents