Mono.Cecil, Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'

Will picture Will · Dec 4, 2010 · Viewed 7.2k times · Source

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.

Answer

Johannes Rudolph picture Johannes Rudolph · Dec 4, 2010

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.

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...).

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.