NET a Bli .NET Assemblies

NET a Bli .NET Assemblies

.NET A ssem blies This material is based on the original slides of Dr. Mark Sapossnek, Computer Science Department, Boston University, Mosh Teitelbaum, evoch, LLC, and Joe Hummel, Lake Forest College Assemblies Overview Assemblies can be: Static: DLL, EXE z Uses existing COFF binary format Via existing extension mechanism Dynamic Create assemblies with .NET Framework SDK Visual Studio.NET Your own code z Dynamic assemblies AsseAssembliesmblies Components of an Assembly Manifest Metadata about the assembly itself Type metadata Completely describes all types defined in an assembly Managed code Microsoft Intermediate Language (MSIL) Resources For example , . bmp, . jpg Assemblies Components of an Assembly ParcelTracker.DLL Manifest Type Metadata MSIL Resources Assemblies Demo: ILDASM.EXE & Private Assemblies Allows you to inspect the metadata and disassembled IL code in an assembly Great way to see what’s really going on Use ildasm /? to see the various options Assemblies Global Assembly Cache AfA set of assem blihbfdbblies that can be referenced by any application on a machine Should be used only when needed Private assemblies are preferred Located at %SystemRoot%\assembly (c:\windows\assembly) Add assemblies by Installer program gacutil.exe Windows Explorer z Assembly Cache Viewer (shfusion.dll) is a shell extension for GAC that is installed with the .NET Framework SDK .NET Framework Configuration Tool (mscorcfg.msc) Assembly must have a strong name AsseAssembliesmblies Strong Names Strong names identify an assembly Contains text name, version, culture, public key, and digital signature Digital Signature = E_private(Assembly Hash) Generated from an assembly using a private key Benefits Guarantees name uniqueness Protect version lineage z No one else can create a new version of your assembly Provides strong integrity check z Guarantees that contents of an assembly didn’ t change since it was built Assemblies Strong Names To sign an assembly with a strong name: Use Strong Name tool: sn.exe Use assembly attributes [AssemblyKeyFileAttribute(“key.snk”)] Requires a key pair (private and public) To generate a key pair use the Strong Name tool: sn.exe –k key.snk AsseAssembliesmblies Demo: Installing an Assembly in GAC Create assembly Sign assembly with key from sn.exe Install into GAC via gacutil.exe, Assembly Cache Viewer and .NET Framework Configuration Tool Assemblies Demo: Adding Resources to your assembly Using Visual Studio 2008.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us