If I have a code like this:
public class Program
{
public static void Main()
{
string bar = \"\";
int foo = 24;
}
}
I think you're looking at a Debug build. The id
part of the .locals
declaration is optional - so there's no guarantee that the names are retained.
See MS Partition II which describes the IL Metadata, section 15.4.1.3 for further details:
MethodBodyItem ::= …
.locals [ init ] ‘(’ LocalsSignature ‘)’
LocalsSignature ::= Local [ ‘,’ Local ]*
Local ::= Type [ Id ]