Global Assembly - PowerPoint PPT Presentation

global assembly n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Global Assembly PowerPoint Presentation
Download Presentation
Global Assembly

play fullscreen
1 / 7
Global Assembly
167 Views
Download Presentation
amaris
Download Presentation

Global Assembly

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Global Assembly • Publicly sharing functionality among different applications. • Located in Global Assembly Cache. • Identified by globally unique name ,culture, version and public key. • Digital signature to ensure that it can’t be tampered with. • Smaller exe files • Dynamic linking i.e loading on demand

  2. Hashing

  3. Public/private keys

  4. Placing a strong name in assembly

  5. Checking strong name in assemb

  6. Creating a global assembly 1)create the key pair using strong name tool (sn) - c:\cs> sn –k myKeyPair.snk 2)Create a source file named ga.cs and add the following attributes at the beginning [assembly:AssemblyKeyFile(“myKeyPair.snk")] [assembly:AssemblyVersion("1.0.0.0")] 3) Create a module out of the source file (ga.cs  ga.dll) c:\cs> csc /t:module /out:bin\ga.dll ga.cs 4) Create a global assembly named myga.dll from ga.dll using al (assembly linker). c:\cs> al /t:library /out:bin\myga.dll bin\ga.dll [or] c:\cs>al /t:library /keyfile:app.snk /v:1.0.0.0 /out:bin\myga.dll bin\ga.dll If you didn’t add the attributes to the sourfile.

  7. Creating a global assembly 5) Load the global assembly (myga.dll) to GAC (Global Assembly Cache) using ‘gacutil’ C:\cs>gacutil –i bin\myga.dll - i switch installs the assembly into global assembly cache. 6) Check if ur assembly has been installed by using the following command c:\cs>gacutil –l myga