July 2003
Intermediate to advanced
736 pages
16h 35m
English
Emitting IL is a low-level way to use Reflection to emit assemblies. You can emit a .NET language—instead of IL—by using the classes in the System.CodeDom namespace. CodeDOM can be used to emit and compile code (System.CodeDom.Compiler); applications that write .NET code using CodeDOM are referred to as code generators.
Listing 5.12 demonstrates how to create a code generator that generates VB .NET code and compiles that code to an executable assembly. The example uses CodeDOM to generate Visual Basic .NET code that produces an assembly equivalent to the emitted IL assembly from Listing 5.11.
1: Option Strict On 2: Option Explicit On 3: 4: Imports System.CodeDom ... |
Read now
Unlock full access