4

I am running XUbuntu 16.04 and I installed mono-complete and monodevelop. However when I run Monodevelop, I can't create a web project. It seems like ASP.NET is not installed.

How can I install ASP.NET? Thanks

6

I also had this issue. As an aside, MonoDevelop (with the ASP.NET add-in) still works fine in Ubuntu 14.04 and 14.10, so I am unsure what has changed to make it not work in Ubuntu 16.04.

In my case, this was enough to push me off Ubuntu and over to Fedora (with CentOS servers for my Mono/ASP.NET application). Fedora 23 runs MonoDevelop with ASP.NET and NUnit perfectly, straight out of the box.

I found a question about this on Stack Overflow a few weeks ago, and I note that it has just had a response from someone claiming that they have found a resolution: https://stackoverflow.com/questions/36101232/asp-net-template-not-found-after-installed-monodevelop-ide-on-ubuntu-16-04

UPDATE: There is a confirmed resolution to this issue at the SO link above. I have created a step by step resolution (thanks to Abu for the original post) that will guide you through it.

UPDATE 2: I have written this up as a blog post on my website, so hopefully this brings further attention to this issue, which really shouldn't be happening in an LTS. The full post is at https://brendaningram.com/article/how-to-fix-monodevelop-on-ubuntu-16-04/

This is how to resolve the issue:

Firstly, setup using the following commands, which are as per the official Mono installation instructions, but with the change from wheezy to alpha.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF  
echo "deb http://download.mono-project.com/repo/debian alpha main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list  
sudo apt-get update  

Then, install Mono itself:

sudo apt-get install mono-devel mono-complete ca-certificates-mono mono-xsp4

Then, to install the specific version of MonoDevelop that gives you a working ASP.NET add-in:

sudo apt-get install monodevelop=5.10.0.871-0xamarin2

I am not completely happy with this solution, obviously. A mainstream distribution such as Ubuntu (and especially their current LTS) should not have these kinds of regression issues. However, we at least have a resolution to the issue.

Of note is that Fedora Workstation 23 has a working Mono/MonoDevelop/ASP.NET environment straight out of the box. While I have previously been a Debian/Ubuntu user, this issue was enough to push me across to Fedora, where I have been happily working away without a single bug or other issue. Will I stay with Fedora? That’s uncertain, but it has certainly been a pleasure to find an enjoyable and stable alternative to Ubuntu.

2

The best way is to compile MonoDevelop from source, as the official 6 distro runs in the flatpak sandbox. If you're developing stuff, that must not run in a sandbox, that's bad. Here's a very good tutorial how to build from source, that works:

Here are the steps from this blog post which has the full details:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

(don't worry about the repository name - the post is specific to Ubuntu 16.04 and later)

sudo apt update && sudo apt upgrade

Get the dependencies

sudo apt install -y autoconf automake cmake fsharp git gnome-sharp2 gtk-sharp2 libssh2-1-dev mono-complete referenceassemblies-pcl zlib1g-dev

Now cd to the directory where you want to install, for example, ~/Apps/MonoDevelop and clone the source into it

git clone https://github.com/mono/monodevelop.git --branch monodevelop-6.1.2.44 --depth 1 6.1.2.44

In this example, we acquire MonoDevelop 6.1.2.44, but it’s possible to acquire other versions as well. The list of released versions can be found on the releases page.

The last option in the command is the name of the directory where the source code will be located. So, after running this command, a new directory named 6.1.2.44 will appear. This directory structure will allow us to use multiple MonoDevelop versions at the same time. For example:

~/Apps/MonoDevelop/6.1.2.44
~/Apps/MonoDevelop/6.2.0.1499

cd to a directory with a version of MonoDevelop that you’re going to build, for example

cd ~/Apps/MonoDevelop/6.1.2.44

Configure the build

./configure --profile=stable --enable-release

Build MonoDevelop:

make

Sometimes, the build may fail because some of NuGet packages cannot be found. The error may look similar to this one:

mono .nuget/NuGet.exe restore
Unable to find version '2.8.2' of package 'NuGet.CommandLine'.
Unable to find version '2.6.4' of package 'NUnit.Runners'.
Makefile:1124: recipe for target 'restore-packages' failed

In this case restore NuGet packages:

mono main/external/nuget-binary/nuget.exe restore main/Main.sln

And try again

Assuming that the build completed successfully, we can now run MonoDevelop from the directory with

make run

See the link (or other posts here) for steps to create a .desktop file for easy launching. Sample .desktop file contents:

[Desktop Entry]
Type=Application
Terminal=false
Icon=/home/USER/Apps/MonoDevelop/6.1.2.44/main/theme-icons/GNOME/monodevelop-48.png
Name=MonoDevelop
Exec=make --directory /home/USER/Apps/MonoDevelop/6.1.2.44 run

X-Ayatana-Desktop-Shortcuts=6.1.2.44;6.2.0.1499

[6.1.2.44 Shortcut Group]
Name=6.1.2.44
Exec=make --directory /home/USER/Apps/MonoDevelop/6.1.2.44 run

[6.2.0.1499 Shortcut Group]
Name=6.2.0.1499
Exec=make --directory /home/USER/Apps/MonoDevelop/6.2.0.1499 run
  • 3
    Welcome to Ask Ubuntu! ;-) Although your answer is 100% correct, it will also become 100% useless if that link is moved, archived, deleted or the site just ceases to exist! Therefore, please copy the relevant parts from that site to your answer and leave the link at the bottom as a reference to your source. – Fabby Jan 30 '17 at 21:25

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.