Deployment - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Deployment

Description:

as .CAB files for traditional' installation. Only one assembly per CAB file ... Example: MyDll.DLL MyDll.CAB ...as .CAB files for download with IE = 5.5 ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 33
Provided by: holgerho
Category:
Tags: cab | deployment

less

Transcript and Presenter's Notes

Title: Deployment


1
Deployment
Your Salvation from DLL Hell
2
Objectives
  • Overview
  • Assemblies
  • XCopy Deployment
  • Configuration
  • Administration

3
Contents
  • Section 1 Looking Back
  • Section 2 Basic Deployment
  • Section 3 Advanced Tasks
  • Section 4 Putting it all together
  • Summary

4
Section 1 Looking Back
  • DLL Hell
  • Version Conflicts
  • Installation Directories
  • Uninstall

5
Section 2 Basic Deployment
  • Assemblies
  • "Xcopy" Deployment
  • Packaging
  • Configuration
  • Locating Assemblies

6
Assemblies 1/3
  • Assemblies are the building blocks of an
    application
  • Logical DLLs
  • Self-describing via Metadata
  • Versioning
  • Security
  • Private Assemblies
  • Shared Assemblies
  • More detailed Information see Module Assembly

7
Assemblies 2/3
  • Private Assemblies
  • Only visible for the application
  • Stored in application folder or subdirectory
  • Isolated from changes to the system
  • No naming requirements (except uniqueness to
    application)

Application
App.exe
Assembly1.dll
Assembly2.dll
8
Assemblies 3/3
  • Shared Assemblies
  • Stored in the Global Assembly Cache (GAC)
  • Strong Names required
  • Versioning
  • Signing
  • Install with
  • Installer for deployment tasks
  • Gacutil.exe for development
  • Gacutil i mydll.dll
  • Admin rights required

9
XCopy Deployment
  • Just copy assemblies to application path
  • Local or network path allowed
  • .NET Runtime required on executing machine
  • Uninstall means just deleting assemblies

10
Avoiding DLL Hell
  • No registration of components
  • No copying to windir\System32 needed
  • Side-By-Side Versioning for shared components
  • No risk of overwriting components

11
Packaging
  • Packaging a .NET Application
  • Configuration Files
  • Locating Assemblies

12
Packaging The Application
  • Packaging a .NET Application
  • as .MSI or .MSM files for Windows Installer
  • as .CAB files for traditional installation
  • Only one assembly per CAB file
  • Same name as file in assembly that contains
    manifest Example MyDll.DLL ? MyDll.CAB
  • as .CAB files for download with IE gt 5.5
  • Specify location to search for referenced
    assembliesin configuration file

13
Configuration Files 1/4
  • ltapplicationgt.cfg
  • Used for application-specific configuration
  • Must be in same location as applications main
    .EXE
  • Admin.cfg
  • Global for each computer
  • Overrides any other configuration file
  • Resides in windir (I.e. C\WINNT )
  • XML-Files
  • Human readable and editable

14
Configuration Files 2/4
  • Specify behavior of Common Language Runtime
  • AppDomain
  • Tells runtime where to look for assemblies

app.cfg
RootDir
Subdir1
Assembly1
Subdir2
15
Configuration Files 3/4
  • BindingMode
  • Normal Use version policy (major.minor / QFE)
  • Safe Bind to exact version
  • BindingRedir
  • Tells runtime to use specific version
  • CodeBaseHint
  • Explicitly causes runtime to look for assemblies
    in specified location

16
Configuration Files 4/4
  • Application.cfg samplelt?xml version "1.0"?gt
  • ltConfigurationgt
  • ltAppDomain PrivatePath"binmycode"
  • ShadowCopy"True"/gt
  • ltBindingModegt
  • ltAppBindingMode Mode"normal"/gt
  • lt/BindingModegt
  • ltBindingPolicygt
  • ltBindingRedir Name"MyCode.dll"
  • Originator"3e59bf1a5ed0ec84"
  • Version"" VersionNew"3.3.3.3"
  • UseLatestBuildRevision"no"/gt
  • lt/BindingPolicygt
  • ltAssembliesgt
  • ltCodeBaseHint Name"MyCode.dll"
  • Originator"3e59bf1a5ed0ec84"
  • Version"3.3.3.3"
  • CodeBase"http//codebasehint/Mydll.dll"/gt
  • lt/Assembliesgt


17
Locating Assemblies
  • Searching for
  • Files with extensions .mcl, .dll, .exe
  • Shared Assemblies
  • Steps
  • Apply ltApplicationgt.cfg policy
  • Search in
  • Application directory
  • Subdirectories specified in PrivatePath
  • Subdirectory named like assembly
  • Global Assembly Cache
  • Apply admin.cfg policy

18
Section 3 Advanced Tasks
  • Installation Components
  • COM Components
  • Serviced Components
  • ASP.NET
  • Using Installation Services
  • Maintenance
  • Administration

19
Installation Components 1/2
  • Installation Components
  • Created in InstallerClass of your application
  • Install associated Resources
  • MessageQueues
  • EventLog
  • PerformanceCounter
  • Services

20
Installation Components 2/2
  • Installation Components
  • Save state in text files
  • Transactional Installation
  • Commit, if succeeded
  • Rollback, if at least one failed
  • Support for uninstall
  • Not transactional

21
COM Components
  • Components that will be called via COM must be
    registered
  • Using RegAsm /tlbfilename
  • Assembly must be in path of calling application
  • Runtime creates a COM Callable Wrapper (CCW)
  • Reference counted like COM Object
  • Transparent to assembly
  • Handles marshalling

22
Serviced Components
  • Typically hosted in COM
  • Derived from ServicedComponent
  • Dynamic Registration
  • Xcopy to destination path
  • Registers automatically on first use
  • Manual Registration using RegSvcs.exe
  • .NET Services Installation Tool
  • Loads and registers an assembly
  • Generates, registers and installs the type
    library into an existing COM application
  • Compulsory for unmanaged clients

23
ASP.NET Deployment
  • Deploy by simply xcopy to server
  • WebPages
  • WebServices
  • Compiled Components
  • Configuration (Meta)Data
  • Advantages
  • No registration needed
  • No local server access needed
  • No web server restarts needed

24
Using Installation Services
  • Windows Installer 1.5 supports assemblies
  • Use assemblies as components
  • All Windows Installer Features available
  • Local Remote installation
  • Resiliency (Recover from broken installations)
  • Installation-On-Demand
  • Maintenance Installation
  • Supported by
  • SMS
  • IntelliMirror

25
Maintenance
  • Installing new version of private assembly
  • Replace original file
  • Developer is responsible for function
  • Installing QuickFix of assembly
  • Install in GAC
  • Applications automatically use QuickFix version
  • Except version policy denies this
  • Install new version of shared assembly
  • Install in GAC
  • Depending on version policy (app.cfg or
    admin.cfg) application uses new or previous
    version

26
Administration 1/2
  • Deleting Shared Assemblies
  • Use Gacutil.exe
  • Gacutil -u myDll,Ver1.1.0.0,Locen,PK874e
  • Use Windows Explorer Shell Extension
  • Right Click in Global Assembly Cache
  • Admin rights required

27
Administration 2/2
  • Clearing Download Cache
  • Cleared automatically based on LRU Policy
  • No manual action necessary
  • Moving Applications
  • Just move complete local file structure
  • Managing Applications After Deployment
  • Use DynamicProperties
  • Change properties via XML files
  • No need to recompile
  • Changes will be applied after next start

28
Section 4 Putting it all together
  • Demo
  • Creating a simple Application Package
  • Creating a complex SetupProject

29
Demo Simple Application
30
Demo SetupProject
31
Summary
  • .NET simplifies Deployment
  • Local
  • Remote
  • Web based
  • .NET avoids DLL Hell
  • No more need for third party Installers?
  • Theres enough left to be done

32
Questions?
Write a Comment
User Comments (0)
About PowerShow.com