Presentation is loading. Please wait.

Presentation is loading. Please wait.

Deployment Your Salvation from DLL Hell. Objectives Overview Assemblies „XCopy“ Deployment Configuration Administration.

Similar presentations


Presentation on theme: "Deployment Your Salvation from DLL Hell. Objectives Overview Assemblies „XCopy“ Deployment Configuration Administration."— 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 assemblies in configuration file

13 Configuration Files 1/4.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 RootDir Subdir1 Subdir2 app.cfg Assembly1

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: <AppDomain PrivatePath="bin;mycode" ShadowCopy="True"/> <BindingRedirName="MyCode.dll" Originator="3e59bf1a5ed0ec84" Version="*" VersionNew="3.3.3.3" UseLatestBuildRevision="no"/> <CodeBaseHint Name="MyCode.dll" Originator="3e59bf1a5ed0ec84" Version="3.3.3.3" CodeBase="http://codebasehint/Mydll.dll"/>

17 Locating Assemblies Searching for Files with extensions.mcl,.dll,.exe Shared Assemblies Steps Apply.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 /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 App CLR CCW Assembly COM.NET

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?


Download ppt "Deployment Your Salvation from DLL Hell. Objectives Overview Assemblies „XCopy“ Deployment Configuration Administration."

Similar presentations


Ads by Google