home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / Readme_htm_130________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Extensible Markup Language  |  2003-03-28  |  6.5 KB  |  84 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8"?><root xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:d2="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><?xml-stylesheet type="text/xsl" href="..\..\..\readme.xsl"?><HTML><HEAD><TITLE>Dynamic Type Resolution Sample</TITLE><STYLE>
  2.     .Title{FONT-FAMILY: Verdana;FONT-SIZE: large;COLOR: #808080}
  3.     </STYLE><STYLE>
  4.     .Heading{FONT-FAMILY: Verdana;FONT-SIZE: large}
  5.     </STYLE><STYLE>
  6.     .SectionBreak{FONT-SIZE: small;MARGIN-BOTTOM: 2em}
  7.     </STYLE><STYLE>
  8.     .SmallBreak{FONT-SIZE: small;MARGIN-BOTTOM: 1.5em}
  9.     </STYLE><STYLE>
  10.     .Text{FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  11.     </STYLE><STYLE>
  12.     .FixedHeading{FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  13.     </STYLE><STYLE>
  14.     .FixedText{MARGIN-LEFT: 3ex;FONT-FAMILY: Lucida Console;FONT-SIZE: x-small;FONT-WEIGHT: Bold}
  15.     </STYLE><STYLE>
  16.     .ListSansBullets {list-style-type: none;FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  17.     </STYLE></HEAD><BODY><table><tr><td><h2 class="Title">Dynamic Type Resolution Sample</h2></td><td valign="baseline" class="Text">
  18.             ┬á┬á┬á
  19.               
  20.                   (Console Application)
  21.                 </td></tr></table><p class="Text">
  22.     This document contains the release information for the .NET Framework DynamicTypeResolve sample. You will find the following sections below: 
  23.     </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" />
  24.     Overview
  25.     </h4><p class="Text">
  26. 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. 
  27. </p><p class="SectionBreak" /><h4 class="Heading"><a name="_Sample_Topics" />
  28.   Topics
  29.   </h4><p class="Text">
  30.   The following bullets briefly describe the classes and technologies used by this sample.
  31.   </p><ul class="Text"><li><b>Reflection - </b><ul class="Text"><li><b>AppDomain - </b>
  32.       The AssemblyResolve event property of this class is used to add an event-handler that is called when a type load fails.
  33.       </li></ul><ul class="Text"><li><b>Activator - </b>
  34.       Is used to create instances of a type whose name is not necessary known at compile time.
  35.       </li></ul><ul class="Text"><li><b>MethodInfo - </b>
  36.       Used to invoke a method on a type, where the method name is not necessarily known at compile time.
  37.       </li></ul><ul class="Text"><li><b>AssemblyBuilder - </b>
  38.       Used to emit a dynamic assembly at run-time.
  39.       </li></ul><ul class="Text"><li><b>AssemblyName - </b>
  40.       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.
  41.       </li></ul><ul class="Text"><li><b>ModuleBuilder - </b>
  42.       Used to build a dynamic module in the dynamic assembly.
  43.       </li></ul><ul class="Text"><li><b>TypeBuilder - </b>
  44.       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.
  45.       </li></ul><ul class="Text"><li><b>MethodBuilder - </b>
  46.       Used to define a method in a dynamic type.
  47.       </li></ul><ul class="Text"><li><b>ILGenerator - </b>
  48.       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.
  49.       </li></ul></li><li><b>Delegates and Events - </b><ul class="Text"><li><b>ResolveEventHandler - </b>
  50.       Used to indicate a callback method to be called when a type-resolution fails.
  51.       </li></ul></li></ul><p class="SectionBreak" /><h4 class="Heading"><a name="_Location_of_Sample" />
  52.     Location
  53.     </h4><p class="Text">
  54.     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.
  55.     </p><p class="FixedHeading">
  56.     For Example:
  57.       <p class="FixedText">
  58.       C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Reflection\DynamicTypeResolve</p></p><p class="SectionBreak" /><h4 class="Heading"><a name="_Building_the_Sample" />
  59.     Building the Sample
  60.     </h4><p class="Text">
  61.     In order to properly build and run this sample, the following steps need to be performed.
  62.     </p><p class="Text">
  63.       Type <b>BUILD.bat</b> from the command line.<p class="FixedHeading">
  64.   For Example:
  65.   </p><p class="FixedText">
  66.          C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Reflection\DynamicTypeResolve\VB>Build.bat
  67.       </p></p><p class="SectionBreak" /><h4 class="Heading"><a name="_Running_the_Sample" />
  68.     Running the Sample
  69.     </h4><p class="Text">
  70.     In order to run this sample, follow the instructions listed below.
  71.     </p><span class="Text"><ul class="Text"><li>
  72.       Type <b>TypeResolve.exe</b> from the command line.<p class="FixedHeading">
  73.   For Example:
  74.   </p><p class="FixedText">
  75.          C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Reflection\DynamicTypeResolve\VB>TypeResolve.exe
  76.       </p></li></ul></span><p class="SectionBreak" /><h4 class="Heading"><a name="_sdkvars" />
  77.     Notes
  78.     </h4><p class="Text">
  79.     For the .Net Framework samples to function properly, your Path, Include, and Lib environment variables must be set correctly. 
  80.     In many cases, the SDK install program updates these environment variables for you. However, if you installed the .Net Framework SDK 
  81.     using Visual Studio .NET, or unselected "register environment variables" during setup, these environment variables will not be updated. 
  82.     You can set the Path, Include and Lib environment variables by running SDKVars.bat, located in the <i><SDKRoot>\Bin</i> directory. 
  83.     SDKVars.bat must be executed in every command shell.
  84.     </p></BODY></HTML></root>