开发者

Reflect specific framework version?

Using Mono.Cecil

if (MethodDefinition.ReturnType == AssemblyDefinition.MainModule.Import(typeof(string)))

Is failing because the assembly I reading is .net 2 but my program is .net 4. So it is tryi开发者_运维技巧ng to compare string v2 and string v4 so it will never be equal. How can I get the string from v2 without building my program with .net 2?


Your question is similar to this one

In short, you should be able to get the string type with this :

AssemblyDefinition.MainModule.TypeSystem.String
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜