Top "Cil" questions

Common Intermediate Language is the object-oriented assembly language used by the .NET Framework, .NET Core, and Mono.

Indexing arrays with enums in C#

I have a lot of fixed-size collections of numbers where each entry can be accessed with a constant. Naturally this …

c# arrays enums cil
What's the point of MethodImplOptions.InternalCall?

Many methods in the BCL are marked with the [MethodImpl(MethodImplOptions.InternalCall)] attribute. This indicates that the "method is implemented …

.net clr cil framework-design
How to insert CIL code to C#

Is it possible to insert IL code to C# method?

c# cil
ILDASM and ILASM, how use them?

I'm having a hard time trying to (Dis)assemble a dll using the Visual Studio command prompt, don't look that …

c# disassembly cil ildasm ilasm
What can you do in MSIL that you cannot do in C# or VB.NET?

All code written in .NET languages compiles to MSIL, but are there specific tasks / operations that you can do only …

c# .net clr cil
Modifying Existing .NET Assemblies

Is there a way to modify existing .NET assemblies without resorting to 3rd party tools? I know that PostSharp makes …

.net reflection assemblies reflection.emit cil
Creating method dynamically, and executing it

Background: I want to define few static methods in C# , and generate IL code as byte array, from one of …

c# reflection cil reflection.emit il
Implicit conversion to System.Double with a nullable struct via compiler generated locals: why is this failing?

Given the following, why does the InvalidCastException get thrown? I can't see why it should be outside of a bug (…

c# nullable cil compiler-generated
Generate tail call opcode

Out of curiosity I was trying to generate a tail call opcode using C#. Fibinacci is an easy one, so …

c# recursion f# tail-recursion cil