有什么用IL文件从.NET产生的(使用MSIL assembler- ilasm.exe)?什么用、文件、IL、NET

2023-09-05 01:12:46 作者:此夜此月

用的是什么,从.NET产生IL文件(使用MSIL assembler- ilasm.exe)?

What is the use of IL file generated from .NET (using MSIL assembler- ilasm.exe)?

我从 http://msdn.microsoft.com/en-阅读美国/库/ 496e4ekx.aspx 但我不知道使用IL文件从.NET产生的(使用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?

推荐答案

您可能要直接使用IL在那些(诚然罕见的)情况下,当如C#高级语言不提供precision或者功能需要。

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.

例如,有在 System.Dynamic 一些功能,从动态语言如IronPython的不能很容易地在C#中使用使用。直接去IL可以帮助那些你需要混合的语言,也许是一个第三方库的情况。

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.

在另一方面,的拆卸的对IL可以是非常有用的,你可以找到code是什么,编译器为你的C#程序产生。这是无价的微优化的性能问题,例如。

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.

 
精彩推荐
图片推荐