Compiled mono missing default .NET libraries – System.Object is not defined or imported

If there is a warning similar to:

/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v2.0'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

You can override the .NET Framework on the command line:

xbuild /p:TargetFrameworkVersion="v4.0"

You can change your solution:

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

Leave a Comment