The .NET languages are growing more pervasive by each passing day. We, therefore decided to explore the world of Intermediate Language (IL), a language to which all the source code written in various languages such as C#, COBOL etc. get compiled. IL represents the transient stage in the process of conversion of source code into machine language. It is inescapably imperative to gain mastery over IL, because knowledge of IL translates into competence over IL code that may have originally been written in any programming language. Thus, it provides a common platform to all the programming languages. Realising its importance in the scheme of things in the .NET world, we decided to get under the skin of IL and unravel its mysteries.


IL puts an end to the unending dissidence amongst programmers with regard to the superiority of one programming language over the others. To this end, IL is a great leveller. It is also a stupendous facilitator because, in the .NET world, one part of the code may have been written in COBOL, while another may have been written in C#, but it all eventually gets converted into IL. This provides great freedom and flexibility to a programmer to select the language he/she is most familiar with and does away with the need to constantly retrain oneslf to learn new languages that seem to crop up every other day.


Our modus operandi has been to strip the sheen of complexity surrounding IL by presenting complex concepts in a simple and comprehensible manner. These concepts have been corroborated with lucid examples. We have put into service all the powers of clairvoyance at our disposal to discover and illustrate concepts of IL, that are not readily discernible to the layman.


To facilitate the understanding of the sample programs, in every example, we have first presented the source code of the programs in the C# language, and then, we have offered their equivalent IL code. Thereafter, we have applied reverse engineering to fathom the IL code by unravelling the equivalent C# code. We have demonstrated how, in some cases, IL transcends the limitations of conventional programming languages; while in others, it falls awfully short of expectations. Though we don't expect undue approbation, it would not be immodest to mention that, while working with the Beta version of IL, we have unearthed many undocumented features and lacunae, which we have highlighted in the book for your benefit.


To conclude, it can be stated that the aim of this book is to explain the various nuances of IL and to make you adept at understanding IL code. It is also our desire to alleviate your fear of lower level languages. The lure of IL lies in its simplicity coupled with its tremendous power, which makes an intoxicating cocktail. But, don't be beguiled by the apparant simplicity of the examples. We don't expect an acquiescent attitude from you. Instead, we implore you to try out all the examples by yourelf and ascertain their outcome. Thus, don't stand ruminating at the brink of this exciting sea of knowledge. Dive right in! We assure you that you shall come out a winner at the end of this sojourn into the world of IL.


Minimum Requirements


The software requirements to successfully run all the programs in this book are


Operating System - Windows 98/NT/2000

Internet Explorer 5.5

.Net Framework SDK Beta 1 (111 MB)


Internet Explorer 5.5 can be downloaded off the Microsoft site


Net Framework SDK Beta 1 can be downloaded off the Microsoft site

Alternatively, you can visit the download section at Microsoft ( ) and download the .Net framework SDK Beta 1 under the Software Development Kit option.





I wish to thank a number of people who gave me their support, new ideas and inspiration while writing this book.


First and foremost, thanks to Manish Jain, BPB publication for publishing the book.


Special thanks to my co-authors, Akash and Sonal, who have put in their very best in the work assigned to them as without them and their efforts the book would have never seen the light of day.


Thanks to Tanuja Sodhi, an ex-naval officer from the first batch of lady officers and an MBA from JBIMS for editing the book. She is presently freelancing as a creative writer.


Thanks to my cover designers, Altaf Hemani and Kishore Rohra, for designing the cover.


Thanks to Manish Purohit for putting in late hours, formatting and aligning the text in the book.


To, Pradeep Mukhi and Shivanand Shetty, who made it simple for me and my co-authors to come up with the book. They have always been a source of inspiration and encouragement.


A long list of friends and my family need a mention here for their patience and cooperation on this book while it was being written.



-Vijay Mukhi