The .NET framework provides you with the capability to create code on-the-fly through the System.Reflection.Emit namespace. The code that you create through Emit is MSIL code. Essentially, the functionality in this namespace gives you the ability to dynamically create an assembly and a module within that assembly. You can dynamically define any number of classes and methods within the assembly’s module, and then invoke those methods at runtime (which will automatically be JIT compiled to very efficient machine code). You can even save the assembly to disk for later use.
In addition to having the capability to generate MSIL code through System.Reflection.Emit, the .NET CodeDom technology provided by the