.Net Assemblies

9,891 views

Published on

Published in: Technology

.Net Assemblies

  1. 1. .Net Assemblies<br />By: Muhammad Kamran Rafi<br />Kami_khan0597@yahoo.com<br />
  2. 2. Fundamental unit of deployment, version control, reuse, security permission for a .net based application.<br />Logical unit of distribution<br />Take form of .dll or .exe file <br />Building block of .Net based Application<br />Can consist of Single File or Multiple Files called modules<br />A module may be generated from different languages.<br />.Net Assembly<br />
  3. 3. Assemblies are self-describing.<br /> Version dependencies are recorded inside assembly manifest.<br /> Assemblies can be loaded side-by-side.<br /> Installation can be as easy as copying the files that belong to an assembly.<br />Assemblies can be private or shared.<br />Features of Assemblies<br />
  4. 4. Assembly Metadata<br />Type Metadata<br />CIL Code<br />Resources<br />Assembly Structure<br />
  5. 5. Assembly Name<br />Version Information<br />Culture<br />Strong Name Information<br />List of files that make up an assembly<br />Type Reference Information<br />Referenced Assembly Information<br />Assembly Metadata/Manifest<br />
  6. 6. Contains information about the types declared and used in assembly.<br />Classes, interfaces, structs, events , indexers that are used.<br />All information about types i.e. methods, attributes, propertied.<br />Type Metadata<br />
  7. 7. JIT complier gets everything it needs from compiler<br />Used in garbage collection Process<br />.Net provides classes to read metadata<br /> (Reflection API)<br />Features of Metadata<br />
  8. 8. Assembly Contents pictorial view<br />
  9. 9. Code emitted by an appropriate .net language compiler e.g. csc (C# Compiler).<br />MSIL is shipped in portable executable (PE) units.<br />Later JIT compiled to Native Code.<br />Full IL code can be compiled to Native Code using NGEN.exe<br />CIL/MSIL Code<br />
  10. 10. Non-executable data that is part of application<br /> e.g. images, sounds, videos etc.<br />Resources<br />
  11. 11. .NET program execution model (revisited)<br />
  12. 12. Private Assembly (placed in application’s execution directory)<br />Shared Assembly (placed in GAC)<br />Types of Assembly<br />
  13. 13. <ul><li>Particular location on system that contains all global assemblies
  14. 14. Located in OS directory
  15. 15. In Windows XP located at</li></ul>C:Windowsassembly<br /><ul><li>It is location where .Net installs its FCL
  16. 16. Shared by all .Net apps on that machine
  17. 17. Multiple versions of an assembly can live side by side</li></ul>GAC<br />
  18. 18. ILDASM (IL Disassembler)<br />
  19. 19. ILDASM<br />
  20. 20. ILDASM<br />
  21. 21. ILDASM<br />

×