This is the code
.assembly extern mscorlib {}
.assembly UsingTheArgs {}
.method static public void main() cil managed
{
.entrypoint
.maxstack 1
ldstr "Hi my name is {0}"
ldarg.0
ldc.i4.0
ldelem.ref
call void [mscorlib]System.Console::WriteLine(string, object)
ret
}
And it generates a System.InvalidProgramException
, it tells me:
Common Language Runtime detected an invalid program in main ()
What can this be? I am learning MSIL and this is one of my first examples that I try and the truth is that I have no idea why it can not walk.