I tried running the sample code which appears on the documentation page for the System.Reflection.Emit.LocalBuilder class but it appears that the calls to LocalBuilder.SetLocalSymInfo(string, int, int)
aren't doing anything since the IL Dissasembler shows this as the IL for SampleAssembly.dll:
.method public static string Function1(int32 A_0) cil managed
{
// Code size 10 (0xa)
.maxstack 1
.locals init (string V_0,
int32 V_1)
IL_0000: ldarg.0
IL_0001: stloc.1
IL_0002: ldstr "string value"
IL_0007: stloc.0
IL_0008: ldloc.0
IL_0009: ret
} // end of method Example::Function1
Why aren't the variable names (myString
and myInt
) listed in the Dissasembler?
Enviroment Info:
- Windows 7 64 bit
- Visual Studio 2010 Professional SP1
- .Net 4.0.30319 SP1
- Target Framework: .Net 4 Client Profile
- Debug configuration (for the program using System.Reflection.Emit)
Edit: As I noted in a comment, there is a SampleAssembly.pdb file being generated along with the SampleAssembly.dll file.