I am running XUbuntu 16.04 and I installed
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
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=126.96.36.1991-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.
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
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-188.8.131.52 --depth 1 184.108.40.206
In this example, we acquire MonoDevelop 220.127.116.11, 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 18.104.22.168 will appear. This directory structure will allow us to use multiple MonoDevelop versions at the same time. For example:
cd to a directory with a version of MonoDevelop that you’re going to build, for example
Configure the build
./configure --profile=stable --enable-release
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
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/22.214.171.124/main/theme-icons/GNOME/monodevelop-48.png Name=MonoDevelop Exec=make --directory /home/USER/Apps/MonoDevelop/126.96.36.199 run X-Ayatana-Desktop-Shortcuts=188.8.131.52;184.108.40.2069 [220.127.116.11 Shortcut Group] Name=18.104.22.168 Exec=make --directory /home/USER/Apps/MonoDevelop/22.214.171.124 run [126.96.36.1999 Shortcut Group] Name=188.8.131.529 Exec=make --directory /home/USER/Apps/MonoDevelop/184.108.40.2069 run