我尝试运行出现在System.Reflection.Emit.LocalBuilderLocalBuilder.SetLocalSymInfo(string, int, int)
类的文档页面上的示例代码,但由于 IL Dissasembler 将其显示为 SampleAssembly.dll 的 IL ,因此调用似乎没有做任何事情:
.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
为什么反汇编程序中没有列出变量名 (myString
和)?myInt
环境信息:
- 视窗 7 64 位
- Visual Studio 2010 专业版 SP1
- .Net 4.0.30319 SP1
- 目标框架:.Net 4 客户端配置文件
- 调试配置(对于使用 System.Reflection.Emit 的程序)
编辑:正如我在评论中指出的,有一个 SampleAssembly.pdb 文件与 SampleAssembly.dll 文件一起生成。