Presentation is loading. Please wait.

Presentation is loading. Please wait.

Module 4: Deployment and Versioning. Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools.

Similar presentations


Presentation on theme: "Module 4: Deployment and Versioning. Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools."— Presentation transcript:

1 Module 4: Deployment and Versioning

2 Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools

3  Introduction to Application Deployment Common Concepts Simple Applications Componentized Applications Configuration and Distribution

4 Common Concepts Classes and Types Used in.NET Framework Applications Are: Organized in a hierarchy of namespaces Stored in PE files, such as DLLs and EXEs Fully described by metadata Assemblies: Are made up of one or more PE files Contain a manifest that identifies the assembly and its files Specify exported and imported classes and types Are units of deployment, reuse, and versioning

5 Simple Applications Require.NET Runtime Be Installed on Local Computer Can Be Run Directly from a File Server or Copied Locally Make No Registry Entries Cannot Break Another Application Eliminate DLL Hell Can Be Uninstalled by Deleting Locally Copied File(s)

6 Componentized Applications Assemblies Private to an Application Same as a simple application Assemblies Private to Related Applications Deployed into a common subdirectory Assemblies Shared with Other Unrelated Applications Require a strong name and version information Deployed into the global assembly cache

7 Configuration and Distribution Configuration Maintained in plain-text files Deployment Common distribution formats, such as a.CAB file or a.MSI file Common distribution mechanisms, such as Windows 2000 IntelliMirror or Microsoft Systems Management Server

8  Application Deployment Scenarios A Simple Application A Componentized Application Specifying a Path for Private Assemblies A Strong-Named Assembly Deploying Shared Components A Versioned Assembly Creating Multiple Versions of a Strong-Named Assembly Binding Policy Deploying Multiple Versions of a Strong-Named Assembly

9 A Simple Application Use the Microsoft Intermediate Language Disassembler (Ildasm.exe) to Examine the Assembly Manifest Version information Imported types Exported types Deploy the Application by: Running the executable file directly from a file server, or Installing it locally by copying the file Uninstall the application by deleting the file

10 A Componentized Application Assembly Component to Be Used by Application Assembly Stringer.dll is built from Stringer.cs as follows: Client Needs to Reference Assembly Deployment by File Server or Local Copy csc /target:library Stringer.cs csc /reference:Stringer.dll Client.cs

11 Specifying a Path for Private Assemblies Specifying a Directory From Which to Load Private Assemblies. Client.exe.config file specifies a privatePath tag Configuration File’s XML Tags Are Case-Sensitive <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

12 Global Assembly Cache Contains assemblies shared by unrelated applications Strong Names Are Required for Assemblies in the Cache Generate a private key: Add code to source file to specify version and key information: Compile: #if STRONG [assembly: System.Reflection.AssemblyVersion("1.0.0.0")] [assembly: System.Reflection.AssemblyKeyFile("orgKey.snk")] #endif #if STRONG [assembly: System.Reflection.AssemblyVersion("1.0.0.0")] [assembly: System.Reflection.AssemblyKeyFile("orgKey.snk")] #endif csc /define:STRONG /target:library /out:AReverser.dll AReverser.cs csc /define:STRONG /target:library /out:AReverser.dll AReverser.cs sn –k orgKey.snk A Strong-Named Assembly

13 Deploying Shared Components Installing the Strong-Named Component in the Global Assembly Cache Examining the Global Assembly Cache Removing a Shared Component File gacutil /i AReverser.dll gacutil /l gacutil /u AReverser

14 A Versioned Assembly Applications Need to Bind to a Suitable Version of a Shared Assembly The Version Number Is Represented by a 4-Part Number Applications Get the Versions of Assemblies with Which They Were Built and Tested Unless overridden by explicit policy rules...

15 Creating Multiple Versions of a Strong-Named Assembly Building Two New Versions of AReverser with a New Key Pair Specify version 2.0.0.0 for one and 2.0.1.0 for the other For AReverser_v2.0.0.0\AReverser.cs: Build Use Ildasm.exe to Examine Different Versions Note the publickey and version numbers Use Ildasm.exe to Verify Strong Names for Both Assemblies Different.originator property Updated version, 2.0.0.0 or 2.0.1.0 #if STRONG [assembly: System.Reflection.AssemblyVersion("2.0.0.0")] [assembly: System.Reflection.AssemblyKeyFile("orgVerKey.snk")] #endif #if STRONG [assembly: System.Reflection.AssemblyVersion("2.0.0.0")] [assembly: System.Reflection.AssemblyKeyFile("orgVerKey.snk")] #endif csc /define:STRONG /target:library /out:AReverser_v2.0.0.0\AReverser.dll AReverser_v2.0.0.0\AReverser.cs csc /define:STRONG /target:library /out:AReverser_v2.0.0.0\AReverser.dll AReverser_v2.0.0.0\AReverser.cs.assembly AReverser {....publickey = (00 24... 82 B1 F2 A0 ).hash algorithm 0x00008004.ver 2:0:1:0.assembly AReverser {....publickey = (00 24... 82 B1 F2 A0 ).hash algorithm 0x00008004.ver 2:0:1:0

16 Binding Policy Policy Resolution Allows an assembly reference, specified at compile time, to be modified after the application has been deployed without recompiling Happens in the Following Stages: 1. Application-policy resolution 2. Publisher-policy resolution 3. Administrator-policy resolution In Each Stage, an XML Configuration File Is Read Note: XML is case-sensitive Version Numbers of Assemblies That Are Not Strong-Named Are Not Checked Configuration File Tag Examples privatePath bindingRedirect

17 Deploying Multiple Versions of a Strong-Named Assembly Install Both Versions of AReverser.dll into the Global Assembly Cache Compile the VerClient Executable and Specify Version 2.0.0.0 of the AReverser Component Use Version Policies to Control Assembly Binding at Run Time gacutil /i AReverser_v2.0.0.0\AReverser.dll gacutil /i AReverser_v2.0.1.0\AReverser.dll gacutil /i AReverser_v2.0.0.0\AReverser.dll gacutil /i AReverser_v2.0.1.0\AReverser.dll csc /reference:MyStringer\Stringer.dll /reference:AReverser_v2.0.0.0\AReverser.dll VerClient.cs csc /reference:MyStringer\Stringer.dll /reference:AReverser_v2.0.0.0\AReverser.dll VerClient.cs

18  Related Topics and Tools Related Topics Packaging and Deployment Tools

19 Related Topics ASP.NET Assemblies Security Localization

20 Packaging and Deployment Tools Assembly Linker (Al.exe) Global Assembly Cache tool (Gacutil.exe) MSIL Disassembler (Ildasm.exe) Strong Name (Sn.exe) Native Image Generator (Ngen.exe) Assembly Binding Log Viewer (Fuslogvw.exe).NET Framework Configuration Tool (Mscorcfg.msc) Code Access Security Policy Tool (Caspol.exe)

21 Lab 4: Packaging and Deployment

22 Review Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools


Download ppt "Module 4: Deployment and Versioning. Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools."

Similar presentations


Ads by Google