Import libraries error with Mono on Ubuntu 15.04
Asked Answered
S

2

8

After downloading Mono 4.2 (stable release) for Ubuntu, I got errors of importing System Libraries in a C# program to establish a connexion with APNS servers (Apple Push Notification).

To build, I use xbuild command (no parameters).

NB : The build is successfully executed on Windows 10.

CSC: error CS0518: The predefined type `System.Object' is not defined or imported
CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported
CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported
CSC: error CS0518: The predefined type `System.Int32' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported
CSC: error CS0518: The predefined type `System.Int64' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported
CSC: error CS0518: The predefined type `System.Single' is not defined or imported
CSC: error CS0518: The predefined type `System.Double' is not defined or imported
CSC: error CS0518: The predefined type `System.Char' is not defined or imported
CSC: error CS0518: The predefined type `System.Int16' is not defined or imported
CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported
CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported
CSC: error CS0518: The predefined type `System.SByte' is not defined or imported
CSC: error CS0518: The predefined type `System.Byte' is not defined or imported
CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported
CSC: error CS0518: The predefined type `System.String' is not defined or imported
CSC: error CS0518: The predefined type `System.Enum' is not defined or imported
CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported
CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported
CSC: error CS0518: The predefined type `System.Void' is not defined or imported
CSC: error CS0518: The predefined type `System.Array' is not defined or imported
CSC: error CS0518: The predefined type `System.Type' is not defined or imported
CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported
CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported
CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported
CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported
CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported
CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported
CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported
CSC: error CS0518: The predefined type `System.Exception' is not defined or imported

How can I build this on Ubuntu 15.04 ?

Sternum answered 7/12, 2015 at 15:57 Comment(0)
O
8

Change the target framework to .NET 4.5 and you should see it works.

Mono does not support .NET 4.5.2 yet.

Outsider answered 8/12, 2015 at 4:16 Comment(1)
Can be also just not installed proeprversion of .NET (also older one as it was in my case). Anyway switching target framework just helped. ThxWalleyed
P
1

Before making any modification on your code please check:

  • apt-cache policy monodevelop
  • apt-cache policy mono-complete

I had such an issue which solved by checking and re-installing mono-complete packages

Panegyric answered 7/7, 2016 at 19:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.