Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get C# 4.0 in Mono (in xbuild)?

I have a .NET project which uses msbuild that I want to try building in Mono. I can build some of its trivial targets just fine, but if I try the full compilation it fails.

I'm not sure how much of the output is relevant, but these are the first lines that look like trouble:

Target GetFrameworkPaths:
/usr/lib/mono/3.5/Microsoft.Common.targets:  warning : TargetFrameworkVersion 'v4.0' not supported by this toolset (ToolsVersion: 4.0).

and

Target ResolveAssemblyReferences:
/usr/lib/mono/3.5/Microsoft.Common.targets:  warning : Reference 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' not resolved

and

/usr/lib/mono/3.5/Microsoft.CSharp.targets: error : Error executing tool '/usr/bin/dmcs': ApplicationName='/usr/bin/dmcs', CommandLine='/noconfig @/tmp/tmp4749932e.tmp', CurrentDirectory='/home/ken/foo/bar'
                    Task "Csc" execution -- FAILED

I'm running latest Debian unstable. According to this, "dmcs" is the 4.0 compiler. I've not used Mono/xbuild much at all -- is there something special it needs in order to compile a C# 4.0 project? Thanks!

like image 613
Ken Avatar asked Nov 13 '22 23:11

Ken


1 Answers

Sid still has Mono 2.6, you probably need Mono 2.10 (available in experimental).

like image 193
skolima Avatar answered Dec 26 '22 02:12

skolima