[Mono-list] using gmcs and C# 3.0 features without requiring System.Core.dll

Rodrigo Kumpera kumpera at gmail.com
Wed Sep 3 17:45:59 EDT 2008


You need to build a fake System.Core.dll with just these types.

Most probably you can just take mono's System.Core.dll.

On Wed, Sep 3, 2008 at 6:37 PM, Dan Shryock <dan.shryock at gmail.com> wrote:

> Hi All,
>
> I'm working on a project which is using some C# 3.0 features, but I am
> hoping to target the .NET 2.0 runtime on windows.
>
> >From what I have read[1] I should be able to add my own
> implementations of the few types I need.
>
> My real question is how do I stop gmcs from adding references to
> System.Core.dll, and instead use my implementations of those types?
>
> The types I have added to enable extension methods, and generic Func,
> and Action delegates are below:
>
> namespace System{
>        public delegate void Action<T1>(T1 t1);
>        public delegate void Action<T1,T2>(T1 t1,T2 t2);
>        public delegate void Action<T1,T2,T3>(T1 t1,T2 t2,T3 t3);
>        public delegate void Action<T1,T2,T3,T4>(T1 t1,T2 t2,T3 t3,T4 t4);
>        public delegate R Func<R>();
>        public delegate R Func<T1,R>(T1 t1);
>        public delegate R Func<T1,T2,R>(T1 t1,T2 t2);
>        public delegate R Func<T1,T2,T3,R>(T1 t1,T2 t2,T3 t3);
>        public delegate R Func<T1,T2,T3,T4,R>(T1 t1,T2 t2,T3 t3,T4 t4);
> }
> namespace System.Runtime.CompilerServices{
>        public class ExtensionAttribute:Attribute{}
> }
>
> Thanks for any help you can give.
>
> Dan
>
>
>
> [1]
> http://www.danielmoth.com/Blog/2007/05/using-extension-methods-in-fx-20.html
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080903/c041c83f/attachment.html 


More information about the Mono-list mailing list