100 likes | 290 Vues
Chapter 5 – Versioning. Objectives. .NET Version Control Assembly Sharing Custom versioning policies .NET versioning. Assembly Version Number. All assemblies have a version number that applies to all components in the assembly. Version major minor build revision
E N D
Chapter 5 – Versioning CIS 330 - .NET Applications
Objectives • .NET Version Control • Assembly Sharing • Custom versioning policies • .NET versioning CIS 330 - .NET Applications
Assembly Version Number • All assemblies have a version number that applies to all components in the assembly • Version • major • minor • build • revision • Used for Compatibility • strongly named assemblies • friendly named assemblies • Setting • Manually • Automatically • use “*” CIS 330 - .NET Applications
Assembly Deployment Models • Private • Private Assembly: each client app maintains its own private local copy of the assembly • Only one version available at a time - new versions deployed by coping over earlier ones • Shared • Shared Assembly: can be used by multiple client apps. Must install in the global assembly cache (GAC). • Supports multiple versions – enables side-by-side execution of different versions • Assembly Resolver: .NET entity that manages assembly compatibility CIS 330 - .NET Applications
Strong Assembly Names • Provides assembly uniqueness and authenticity • COM uses Globally Unique Identifiers (GUIDs) that are not protected • .NET uses Strong Name: pair of encryption keys; public and private keys • Compiler used private key to encrypt the assembly hash and adds this unique digital signature and public key to the assembly manifest • Private keys must be kept inaccessible • Signing your Assembly: create strong name key file CIS 330 - .NET Applications
Strong Names and Private Assemblies • Private assemblies with only friendly names must be backward-compatible • Private assemblies with strong names don’t need to be backward-compatible (uses GAC) • However, if version number isn’t compatible, may exceptions • The Private assembly deployment model is intended to work with friendly names only CIS 330 - .NET Applications
Visual Studio 2005 and Versioning • Clients can add a reference to Server assemblies without copying the server assembly (thus making it a private assembly) by setting the “Copy Local” property to false. CIS 330 - .NET Applications
Custom Version Policies • Can override default assembly-resolving policy • Custom version-binding policies • Custom codebase policies • Application level • Machine level CIS 330 - .NET Applications
CLR Versioning • Microsoft does not guarantee backward compatibility (2.0 components won’t run on 1.0 or 1.1 CLR versions) • CLR side by side execution • Version Unification • Applications Can specify a CLR version CIS 330 - .NET Applications
Summary • .NET Version Control • Assembly Sharing • Custom versioning policies • .NET versioning CIS 330 - .NET Applications