Emitting IL Code at Runtime

You have more than likely heard that Visual Basic .NET, and in fact all .NET code, is emitted to an Intermediate Language (IL) form when you compile an application. The IL code is actually just-in-time compiled (JITted) before it is actually executed. This follows the Java model of byte code. The foundation for doing this is probably similar to the reasons that Sun implemented Java that way: someone envisions porting .NET to non-Windows machines. It makes sense and is a good idea.

Imagine, some vendor will port VB .NET to the Mac, Linux, and UNIX. Now smart VB .NET programmers everywhere can work on software for any company, anywhere. If you want to see some IL code, run the ildasm.exe (IL disassembler) utility in ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.