user3053493
user3053493

Reputation: 25

Targeting .NET 4.0 with mono 2.4.3.1 on Linux

I don't seem to be able to target .NET 4.0 under linux with the otherwise awesome mono compiler. Most answers to this issue involve using dmcs, which is not available in my distribution (I got mono-core and mono-data version 2.4.3.1-4.el6) - smcs is not available either. Also "gmcs -sdk:4" mentioned on another site doesn't work. My guess is that there is a command line option to force gmcs to compile into 4.0.

Also I noticed that gmcs/mcs scripts use /usr/bin/mono and give a directory as a parameter. The directory (/usr/lib/mono/) doesn't contain version 4.0. It only contains: 1.0 2.0 3.5 compat-1.0 compat-2.0 gac

Am I missing a package?

The reason I need version 4 is the support for optional parameters like: public void func(int years = 5)

Any help or pointers will be appreciated :)

Upvotes: 1

Views: 166

Answers (1)

TheNextman
TheNextman

Reputation: 12566

Your mono version is too old. .NET 4.0 support was added in Mono 2.8 (released October 2010).

The latest version is 3.2.4.

Upvotes: 1

Related Questions