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

Dan Shryock dan.shryock at gmail.com
Wed Sep 3 17:37:54 EDT 2008


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


More information about the Mono-list mailing list