paint-brush
Getting started with .NET on Ubuntu Linuxby@xameeramir
1,778 reads
1,778 reads

Getting started with .NET on Ubuntu Linux

by Zameer AnsariDecember 25th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Since, <a href="http://www.asp.net/vnext" target="_blank">ASP.NET vNext’s</a> <a href="https://dotnet.github.io/" target="_blank">open source</a>&nbsp;<a href="https://dotnet.github.io/" target="_blank">.NET core</a>’s <code class="markup--code markup--p-code"><a href="https://github.com/aspnet/Home/wiki/Roadmap" target="_blank">1.0.0</a></code><a href="https://github.com/aspnet/Home/wiki/Roadmap" target="_blank"> release is nearby</a>, I was trying to get my hands dirty with&nbsp;<a href="https://www.microsoft.com/net" target="_blank">.NET</a> <em>outside </em><a href="https://www.microsoft.com/en-in/windows" target="_blank"><em>Windows</em></a>.

Company Mentioned

Mention Thumbnail
featured image - Getting started with .NET on Ubuntu Linux
Zameer Ansari HackerNoon profile picture

Since, ASP.NET vNext’s open source .NET core’s [1.0.0](https://github.com/aspnet/Home/wiki/Roadmap) release is nearby, I was trying to get my hands dirty with .NET outside Windows.

Install the .NET Version Manager (DNVM)

First install unzip and curl if you don’t already have them

sudo apt-get install unzip curl

Download and install DNVM

curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh

Use dnvm to verify installation

Installing the Mono.NET Execution Environment (DNX)

.NET core is still immature, so for the time being it’s better to at least get started with Mono.

The below commands were tested on a 64bit laptop to install Mono on Ubuntu:

  • Add Signing Key using wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out
  • Add Repository using echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
  • Update repolist using sudo apt-get update
  • Install mono-devel using sudo apt-get install mono-devel
  • Install mono-complete using sudo apt-get install mono-complete
  • Install referenceassemblies-pcl using sudo apt-get install referenceassemblies-pcl

Verify installation using dpkg

apt-cache policy <package-name> can also be used to verify installation

I was having troubles setting up Mono on my Ubuntu 14.4 machine, I was not able to get required [ca-certificates-mono](http://www.mono-project.com/docs/getting-started/install/linux/#notes) package.

So, I had uninstalled Mono with sudo apt-get purge mono-complete and followed the above commands.

Installing libuv

To host ASP.NET MVC 5 apps outside IIS, it’s necessary to install libuv, follow the below commands:









sudo apt-get install make automake libtool curlcurl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/srccd /usr/local/src/libuv-1.4.2sudo sh autogen.shsudo ./configuresudo makesudo make installsudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/sudo ldconfig

Install Monodevelop IDE

From VS code docs

An example of a non-supported project type is an ASP.NET MVC Application.

In this case, MonoDevelop can be used

sudo apt-get install monodevelop

which supports ASP.NET MVC projects.

Phew, it looks like everything is ready to see .NET in action outside Windows.

Photos

Originally published at xameeramir.github.io.