Glam Prestige Journal

Bright entertainment trends with youth appeal.

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 I can't find out how to fix 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 <Import> 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?

2

4 Answers

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 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.

2

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 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

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

I've had luck with setting up monodevelop 7.8.4 (build 2) Mono version 6.12.0.122 on Ubuntu 21.10 using Debian Buster source.

  1. First you will need to install libjpeg62-turbo_1.5.2-2+deb10u1_amd64.deb.

  2. Once you have this installed, open a terminal and type:

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    echo "deb buster main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
    sudo apt update
    sudo apt install monodevelop
  3. At this point monodevelop loads and runs, but will not debug and you will see an error that looks like this:

    ApplicationName='/usr/lib/gnome-terminal/gnome-terminal-server', CommandLine='--app-id mono.develop.id9462e6d67d3f4540ace204fe87960524', CurrentDirectory='', Native error= Cannot find the specified file
  4. To fix this, we go back to the terminal and run:

    cd /usr/lib
    sudo mkdir gnome-terminal
    cd gnome-terminal
    sudo ln -s /usr/libexec/gnome-terminal-server
  5. Reboot and enjoy.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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