</STYLE></HEAD><BODY><table><tr><td><h2 class="Title">Dynamic Type Resolution Sample</h2></td><td valign="baseline" class="Text">
   
(Console Application)
</td></tr></table><p class="Text">
This document contains the release information for the .NET Framework DynamicTypeResolve sample. You will find the following sections below:
</p><ul class="Text"><li><a href="#_Sample_Overview">Overview</a></li><li><a href="#_Sample_Topics">Topics</a></li><li><a href="#_Location_of_Sample">Location</a></li><li><a href="#_Building_the_Sample">Building the sample</a></li><li><a href="#_Running_the_Sample">Running the sample</a></li><li><a href="#_sdkvars">Notes</a></li></ul><p class="SectionBreak" /><h4 class="Heading"><a name="_Sample_Overview" />
Overview
</h4><p class="Text">
This sample demonstrates how hosts can participate in the type resolution process by supplying an event handler that returns an assembly containing the requested type. The sample attempts to instantiate a type that doesn't exist. However, the sample also handles type-load failures, and dynamically creates the necessary type, avoiding a FileNotFoundException. This is an advanced technique, most likely to be utilized by distributed applications in order to facilitate flexibility and fault-tolerance.
This type is used to define the unique identity of an assembly. This sample uses this type in the simplest possible way by giving the dynamic assembly a text name.
This Type-derived type is used to build a type dynamically. From it you can request instances of the FieldBuilder, ConstrutorBuilder, and MethodBuilder types. Using these types the sample generates a complete type.
The MethodBuilder type implements a method called GetILGenerator() which returns an instance of the ILGenerator type. This type is used to dynamically generate IL-code.
</li></ul></li><li><b>Delegates and Events - </b><ul class="Text"><li><b>ResolveEventHandler - </b>
Used to indicate a callback method to be called when a type-resolution fails.
This sample is located in the <a href="." title="Jump to Folder" target="_blank">Technologies\Reflection\DynamicTypeResolve</a> subdirectory of the .NET Framework SDK samples directory.