.NET Fusion Workshop
This is a self paced workshop designed to lead you through the benefits and features of the .NET Fusion technology.
This Workshop Will Teach You
- Location of .NET assemblies and how to change the default locations
- Using .NET tools to resolve problems with assembly locations and how to fix broken applications
- Sharing assemblies with the GAC, updating GAC dependencies with publisher policy files, GAC references
- Satellite assemblies and culture specific resources
- Dynamic loading of assemblies, partial named assemblies
- Accessing the Fusion API
- Fusion and the Compact Framework
- Generating Native Images from .NET Assemblies
- Native Assemblies
Fusion is the .NET technology used to locate and load .NET
assemblies. Assemblies are the unit of deployment, security and type definition.
Assemblies bridge the current technologies of executable files and future
technologies of loading and executing types. In the current versions of .NET
assemblies use the established PE (portable executable) file format, however,
assemblies extend the format and eschew the established mechanism for exporting
executable code (export tables) for a new mechanism called metadata.
Furthermore, where DLLs and EXEs are single, standalone files, assemblies can be
made up of a collection of files: modules and resource files. Each module is a
PE file with a
.text section. .NET does not need any other section
in the PE file, the
.text section contains all of the code, all of
the metadata and all the resources embedded in the module. In effect, the PE file
format is just a wrapper around a complex .NET structure.
While the internal format of assemblies is a big change, it
is not the biggest change. Win32 files can have long names, but these names are
not unique between publishers, or between versions of a file from a single
publisher. This lack of uniqueness caused the infamous 'DLL Hell' problem. .NET
addresses this problem in two ways. First, it changes the way that assemblies
are named, by providing names that contain a version element and an element that
distinguishes between publishers. Second, .NET does not use
System32 to share files. Finally, .NET provides a replacement for
LoadLibrary, called Fusion, that is flexible, configurable, and
removes any possibilities of loading the wrong file by mistake.
This workshop will lead you through the main features of Fusion step by step. You will learn how to configure Fusion, how to understand Fusion logs and how to use the .NET Fusion tools.
The example code for this workshop can be found here.
This workshop was originally written for .NET version 1.1 on Windows XP. When Microsoft released .NET 2.0 I revised the workshop adding annotations for the changes in version 2.0. Since then Microsoft have released 'version 3.0' of the .NET framework. However (with a few minor changes), this is merely version 2.0 distributed with the WinFX library. This means that in most cases .NET 2.0 and .NET 3.0 are interchangeable. In the workshop when I say version 3.0 you can assume that I also mean version 2.0. If I do not mention a version then you should assume that the text refers to all versions of .NET which means 3.0, 2.0, 1.1 and 1.0.
The demonstrations will use the command line tools provided by the .NET SDK and the code will be written in C#. The example code can easily be converted to other .NET languages and can easily be converted to VS.NET projects.
The examples in this workshop will use the following tools:
||The C# compiler|
||The Fusion log viewer|
||The GAC utility|
||The IL disassembly tool|
||Program maintenance utility|
||The strong name generator|
<CORFolder> is the location of the .NET framework assemblies
is the location of the .NET SDK (usually it is in the Visual Studio folder). To
do the examples in the workshop you should ensure that your command line path is
set to give access to the folders in the table. The simplest way to do this is
to run the
vsvars32.bat file in the
folder in the Visual Studio .NET folder.
There is no charge for this tutorial, if this workshop was published as a book then you would pay $50 for it, if I were to give you this workshop as a training session then you would have to pay several thousand dollars, instead, you get it entirely for free. If you want to show your appreciation for the effort I have put into this workshop then please consider making a donation through Paypal.
I give training courses and conference talks, and I write white papers and books on a variety of .NET topics; I also architect systems and perform code reviews. Please contact me if you want me to provide my services for you.
3. Strong Named Assemblies
3.1 Giving an Assembly a Strong Name
3.2 Using DEVPATH
3.3 Codebase with an Absolute Path
3.4 Loading an Assembly from the Internet
3.5 Versioning of Strong Name Assemblies
3.6 Versioning Rebinding
3.7 Versioning Redirection and Codebase
3.8 Delay Signing
3.9 Obfuscation of Strong Named Assemblies
9. Resources and Satellite Assemblies
9.1 Embedded and Linked Resources
9.2 Compiled Resources
9.3 XML Compiled Resources
9.4 Culture Specific Resources
9.5 Strong Named Satellites
9.6 Satellite Versions
9.7 Delay Signing
9.8 Culture Specific Probing
11. Fusion and the Compact Framework
11.1 CF Development
11.2 Private Assemblies
11.3 Locating Libraries
11.5 The GAC
11.6 Programmatically Adding and Removing Assemblies From the GAC
11.7 Strong Name Verification
11.8 Concluding Remarks
12. Native Images
12.1 Loading an Assembly
12.2 Ngened Assemblies in .NET v1.1
12.3 Contents of Native Images in .NET 1.1
12.4 CLR Optimization Service in .NET 3.0/2.0
12.5 Logging Binding to Native Images
12.6 Automatic Redirect to Native Images
12.7 Deferred Updates
12.8 Hard Binding
|I hope that you enjoy this tutorial and value the knowledge that you will gain from it. This tutorial is free and will always remain free.|