What is the use of IL file generated from .NET (using MSIL assembler- ilasm.exe)?
I read it from http://msdn.microsoft.com/en-us/library/496e4ekx.aspx
but i am not sure about the use of IL file generated from .NET (using MSIL assembler- ilasm.exe).
Can any one explain me?
You might want to use IL directly in those (admittedly rare) situations when a higher level language like C# doesn't provide the precision or features you need.
For instance, there are some features in System.Dynamic
that are used from the dynamic languages such as IronPython that can't easily be used in C#. Going straight to IL can help in those situations where you need to mix languages, perhaps for a third-party library.
On the other hand, disassembling to IL can be very useful as you can find exactly what the code is that the compiler generated for your C# program. This is invaluable for micro-optimising performance issues, for example.
ilasm.exe
— the MSIL Assembler — is a Common Intermediate Language compiler for the .NET Framework's native assembly language (=CIL or IL or MSIL for short).
This tool produces executable files by compiling IL assembly source files. It doesn't generate any “IL files”. The opposite is the ildasm.exe
— the MSIL Disassembler — which does the reverse: decompiles a .NET executable into its IL source.