Extension methods on mono 2.10.8.1

1

I'm developing some software using visual studio where I target v4.5 of the CLR, this software is also being run on Mono v2.10.8.1

All is well until I try to use extension methods, at which point I get the following exception System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly ......

Now if target v4.0 of the CLR with visual studio and run on Mono all is well, I have noticed that the System.Runtime.CompilerServices.ExtensionAttribute class has moved from the System.Core.dll in v4.0 of the CLR to the mscorlib.dll in v4.5

When I run he pedump tool with --verify metadata,code on one of my assemblies I get

Missing method .ctor in assembly myassembly.dll, type System.Runtime.CompilerServices.ExtensionAttribute Error: Invalid CustomAttribute content row 1 Value field 0x00000109 Error: CustomAttribute: Invalid constructor Error count: 2

Has anyone had similar issues ? Any resolutions ?

thanks in advance

Pat

c#
mono
extension-methods
asked on Stack Overflow Feb 12, 2013 by pmcgrath

1 Answer

1

I had the same issue today. Resolved by upgrading the (Debian Wheezy) server to the latest Mono; the staging servers had been Ubuntu Trusty and they did not exhibit this problem.

So this is fixed in Mono 3.2.8+ (which is Ubuntu Trusty's version).

answered on Stack Overflow Nov 7, 2014 by Rick Falkvinge

User contributions licensed under CC BY-SA 3.0