Links to the Web:     Support  |   Search  |   microsoft.com Guide  
 
  Related Links:    MSDN Online  |   Professional Developers Conference  |   PDC Tech Preview Web site  |

Type Resolution Sample

This sample demonstrates how user written code can participate in NGWS's type resolution process.  NGWS has a well defined set of rules it uses to locate the assembly containing a given referenced type.  However, if the target assembly cannot be found through normal means, an event is raised that callers can use to specify which assembly the requested type is in.  This feature will not typically be used in most programs.  It is intended for advanced scenarios where callers have custom loading semantics that can't be satisfied using the default rules established by NGWS.

In this sample we are going to highlight the following topics:
Sample Tour
This sample consists of a main program called host.exe that dynamically loads an assembly called first.dll and executes a method on a type in that assembly.  The method that is executed makes reference to a type in an assembly that doesn't exist.  When first.dll is loaded, host.exe registers an event handler that will be used to provide NGWS with the assembly containing the referenced type.

When the event handler is called, host.exe uses Reflection Emit to create an assembly on the fly.  This assembly contains the type that has been referenced from the first assembly.

Sample Location

Build Instructions
How to Run