Is it possible to use code in MSIL?

I'm just curious to know if this can be done or not. I do not plan to do this unless it packs some significant performance benefits. I am a web and game developer, but I usually do not develop games in C #.

+4
source share
4 answers

Yes, it is possible - you can use ilasm (comes with the .NET SDK) to compile your code. However, there is no IDE support for Visual Studio. There are no performance benefits that you can derive from this that you cannot get by other means - in particular, C ++ / CLI covers all the low-level CLR functions that may bring some benefit and are not available with C # or VB - in the first queue, unboxing without a copy ( ref ), simple unlimited function pointers (as opposed to delegates) and the associated calli IL instruction and ref (a managed pointer in CLI) local variables (as opposed to just parameters).

+14
source

Yes, you can; The Microsoft MSIL Assembler (ilasm.exe) from the .NET SDK will compile your IL to executable code. I see no reason for this, except in very focused areas where you have found a significant performance advantage.

Here is a detailed, if dated, article describing how to do this.

+1
source

Or you can emit a little CIL from your C #. Submit object literal to ILGenerator

0
source

The IDE #Develop (Sharp Develop) has a plugin for il projects. I have not used it, so I'm not sure what help it provides. http://www.icsharpcode.net/OpenSource/SD/

0
source

All Articles