1 / 32

Deployment

Deployment. Your Salvation from DLL Hell. Objectives. Overview Assemblies „XCopy“ Deployment Configuration Administration. Contents. Section 1: Looking Back Section 2: Basic Deployment Section 3: Advanced Tasks Section 4: Putting it all together Summary. Section 1: Looking Back.

Download Presentation

Deployment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 >= 5.5 • Specify location to search for referenced assembliesin configuration file

  13. Configuration Files 1/4 • <application>.cfg • Used for application-specific configuration • Must be in same location as application’s 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 sample:<?xml version ="1.0"?> <Configuration> <AppDomain PrivatePath="bin;mycode" ShadowCopy="True"/> <BindingMode> <AppBindingMode Mode="normal"/> </BindingMode> <BindingPolicy> <BindingRedir Name="MyCode.dll" Originator="3e59bf1a5ed0ec84" Version="*" VersionNew="3.3.3.3" UseLatestBuildRevision="no"/> </BindingPolicy> <Assemblies> <CodeBaseHint Name="MyCode.dll" Originator="3e59bf1a5ed0ec84" Version="3.3.3.3" CodeBase="http://codebasehint/Mydll.dll"/> </Assemblies> </Configuration>

  17. Locating Assemblies • Searching for • Files with extensions .mcl, .dll, .exe • Shared Assemblies • Steps • Apply <Application>.cfg policy • Search in • Application directory • Subdirectories specified inPrivatePath • 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. CLR COM .NET CCW App Assembly COM Components • Components that will be called via COM must be registered • Using RegAsm /tlb[:filename] • 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,Ver=1.1.0.0,Loc=en,PK=874e… • 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? • There’s enough left to be done…

  32. Questions?

More Related