[Mono-dev] Avoiding references to ExtensionAttribute so a program is compatible with MS.NET 2.0
marek.safar at seznam.cz
Sun Nov 16 06:34:51 EST 2008
> I'm attempting to compile a C# program that uses extension methods
> using mono, and have it run under both mono and MS.NET <http://MS.NET>.
> This works fine (gmcs 188.8.131.52 <http://184.108.40.206>) when the target
> Windows system is running MS.NET <http://MS.NET> 3.5, but not when
> running MS.NET <http://MS.NET> 2.0. The problem appears to be the one
> described here:
> If I understand correctly, creating an extension method results in
> your code referring to an attribute that is only in System.Core
> v220.127.116.11 or higher. However, this attribute doesn't actually do anything.
> It appears that the solution the IronPython guys claim to have used
> won't work with Mono, which seems to be pickier about allowing you to
> link when there are duplicated attribute names. However, since we
> have the source code to mono, maybe there's an even easier solution:
> just add an option to gmcs to deliberately leave out that attribute on
> extension methods. Would that work?
You will have to use newer Mono (SVN HEAD, or 2.2) and -noconfig
compiler option to disable System.Core assembly auto-reference.
More information about the Mono-devel-list