WindowsSideBySide
Jump to navigation
Jump to search
Overview
- Topic = Isolated Applications and Side-by-side Assemblies
- Main article = http://msdn.microsoft.com/en-us/library/dd408052.aspx
- Concept for reducing DLL and EXE versioning conflicts
- Concept exists since Windows XP
Isolated application
- "Self-describing" application with a manifest
- Fully Isolated = Application uses only side-by-side assemblies, or only private assemblies
- Is described by a manifest
- The application manifest contains, among other things:
- Dependencies to assemblies (if necessary including versions)
Side-by-side assembly
- Collection of resources that is described by a manifest
- The collection typically is a DLL
- Possibl resources: DLLs, classes, COM server, type libraries, interfaces
- A Side-by-side Assembly has a unique identity; one part of the identity is the version
- The manifest of a side-by-side assembly contains, among other things:
- The identity of an assembly (the assemblyIdentity element)
- Which files are part of the assembly
- Dependencies to other assemblies
- Information about binding and COM activation that traditionally is stored in the Windows Registry (e.g. COM classes, interfaces, type libraries)
Manifest
- XML file that describes a side-by-side assembly or an isolated application
- The manifest of a shared assembly is stored in the system's WinSxS folder
- The manifest of a private assembly is either embedded into the DLL as a resource, or stored in the application folder
- The manifest of an application is either embedded into the EXE as a resource, or stored in the application folder
Search order of assemblies
- First the system searches the shared assemblies in the system's WinSxS folder
- Next the system searches the application's private assemblies
- Detailed example: http://msdn.microsoft.com/en-us/library/aa374224.aspx
Activation context
- http://msdn.microsoft.com/en-us/library/aa374153.aspx
- Good background article: http://blogs.msdn.com/b/junfeng/archive/2006/03/19/sxs-activation-context-activate-and-deactivate.aspx
- An area of memory that is initialised with the content of a manifest
- Defines which concrete version of an assembly/DLL should be loaded
Assembly version
- major.minor.build.revision
- A change to major and/or minor means the assembly is not backwards compatible
Debugging
To solve SxS problems the tool "sxstrace" can be sued. Reference: http://blogs.msdn.com/b/junfeng/archive/2006/04/14/576314.aspx.
Howto:
- Run cmd.exe as administrator
- Start the trace
sxstrace trace -logfile:c:\sxstrace.etl
- Start the program
- Stop the trace by pressing the <ENTER> key in the console
- Analyse the binary trace file:
sxstrace parse -logfile:c:\sxstrace.etl -outfile:c:\sxstrace.txt
- The text file now contains the trace information in human readable format