Mono.Cecil MethodDefinition变量不可见(Mono.Cecil MethodDefinition Variables not visible)

编程入门 行业动态 更新时间:2024-10-24 04:46:00
Mono.Cecil MethodDefinition变量不可见(Mono.Cecil MethodDefinition Variables not visible)

我遇到了一个奇怪的问题,当我尝试列出所选方法中的所有MethodDefinition.Body.Variables时,它似乎在完成循环之前跳过了几个。 我需要使用任何过滤器来查看所述方法中的所有变量吗?(所有这些都是局部变量)

MethodDefinition example = module.GetType("Example.Program").Methods.First(m => m.Name == "Main"); foreach (VariableDefinition def in example.Body.Variables) Console.WriteLine(def.VariableType.Name);

I've encountered a strange issue, when I try to list all of the MethodDefinition.Body.Variables in a selected method it seems to skip over a few before completing the loop. Are there any filters I need to use in order to see all variables within said method?(All of them are local variables)

MethodDefinition example = module.GetType("Example.Program").Methods.First(m => m.Name == "Main"); foreach (VariableDefinition def in example.Body.Variables) Console.WriteLine(def.VariableType.Name);

最满意答案

我已经解决了我的问题,这是我的错。(ILSpy设置,woops)

I've fixed my issue, it was a fault on my side.(ILSpy settings, woops)

更多推荐

本文发布于:2023-08-06 15:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1451549.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   Cecil   Mono   MethodDefinition   visible

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!