[Mono-dev] Avoiding references to ExtensionAttribute so a program is compatible with MS.NET 2.0
apenwarr at gmail.com
Sun Nov 16 04:43:13 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.
This works fine (gmcs 184.108.40.206) when the target Windows system is running
MS.NET 3.5, but not when running 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
Perhaps this is something Cecil would be good for? I've never used it and
don't really understand what it does.
Any pointers would be appreciated. Requiring Windows users to install .Net
3.5 to use my app is a pretty bad idea, since the installer takes *forever*
to run, and most people don't want to touch system-level stuff like that
just to install an app.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list