Mono.Cecil能做到,缺少编译器要求会员'System.Runtime.CompilerServices.ExtensionAttribute..ctor“ [英] Mono.Cecil, Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'

查看:253
本文介绍了Mono.Cecil能做到,缺少编译器要求会员'System.Runtime.CompilerServices.ExtensionAttribute..ctor“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了最新Mono.Cecil能做到,现在每当我开始了我的项目,它给我的错误。它消失了,如果我删除,并添加Mono.Cecil能做到。但是,这是一个痛苦的做好每一项我打开我的项目时间。

I downloaded the latest Mono.Cecil and now whenever I start up my project it gives me that error. It goes away if I remove and add mono.cecil. But that is a pain to do every time I open my project.

推荐答案

这问题是一个良好知道所有.NET问题希望在内部使用扩展方法,因此宣布他们自己的内部2.0项目 System.Runtime.CompilerServices.ExtensionAttribute ,允许这一点。

This issue is a well know problem for all .NET 2.0 Projects that want to use Extension Methods internally and therefore declare their own internal System.Runtime.CompilerServices.ExtensionAttribute to allow this.

有解决这个问题的各种方法,如果你使用.NET 3.5或更高版本,简单地编译Mono.Cecil能做到与 NET_3_5 NET_4_0 定义。如果你的目标。NET 2,你可能会幸运地得到它来编译(这取决于一些编译器内部,绝对不是CSC命令行或的MSBuild)开箱。如果不是,解决方法是剥离从2.0塞西尔组件(使用塞西尔本身...)的属性出现的所有(包括定义)。

There are various ways around this problem, if you're using .NET 3.5 or higher, simply compile Mono.Cecil with NET_3_5 or NET_4_0 defined. If you're targeting .NET 2 you might be lucky and get it to compile (it depends on some compiler internals, definitely not the csc commandline or MSBuild) out of the box. If not, the workaround would be stripping all occurences of that Attribute (including the definition) from the 2.0 Cecil assembly (using Cecil itself...).

我< A HREF =htt​​ps://github.com/InishTech/ExtensionAttributeStripper相对=nofollow>已经做到了这一点这不是什么大不了的事。不过我觉得你的问题是不同的人,所以请提供您正在使用/靶向单声道版本和.NET版本更多的细节。

I have already done this and it's not a big deal. However I feel your issue is a different one, so please provide a little more detail on the Mono Version and .NET version you're using/targeting.

这篇关于Mono.Cecil能做到,缺少编译器要求会员'System.Runtime.CompilerServices.ExtensionAttribute..ctor“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆