2

I am trying to setup a development machine using 20.04 and am having problems with the Monodevelop environment. Whenever I create a solution and project it seems that it cannot find the proper build setup. I suspect there is some problem when using the 18.04 mono repositories on 20.04, but can't find out how to fis it. This is the error I receive when I try to build using the Monodevelop IDE:

/usr/lib/mono/msbuild/15.0/bin/Microsoft.CSharp.CurrentVersion.targets(5,5): Error MSB4019: The imported project "/usr/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. (MSB4019) (HelloWorld)

Does anyone know how to get a working version of Monodevelop on Ubuntu 20.04? Thanks.

  • For close voters - 20.04 LTS is released. About MonoDevelop see askubuntu.com/a/1228572/66509 . – N0rbert Apr 24 at 9:10
  • I'm not using MonoDevelop, but compile projects that have been created in Visual Studio. Since Mono version 5.n I've been using msbuild to compile my projects, but this no longer works in Ubuntu 20.04. In my case, msbuild cannot be found. Trying to install msbuild doesn't fix the issue. – Peter Gloor Apr 25 at 14:07
1

I managed to fix this on Ubuntu 20.04.

First, add mono-project's repo for 18.04 by following the official instructions, pasted here for convenience:

sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

Then install mono-roslyn using:

sudo apt install mono-roslyn

Rebuild your project.

| improve this answer | |
0

I try but get Debugger operation failed ApplicationName='/usr/lib/gnome-terminal/gnome-terminal-server', CommandLine='--app-id mono.develop.id9462e6d67d3f4540ace204fe87960524', CurrentDirectory='', Native error= Cannot find the specified file

enter image description here

| improve this answer | |
0

Mono is not yet available in stable repo, but you can install it with the preview-focal main with the following.

sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list
sudo apt update

# if the packages were already installed
sudo apt upgrade

# otherwise
sudo apt install mono-complete msbuild

Later you can test it with a simple hello world application by creating a file called hello.cs

using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
        Console.WriteLine ("Hello Mono World");
    }
}

Compile it with csc hello.cs. It will generate an exe. Now run it with mono hello.exe and it should work

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.