Installing Mono and .NET Core with Kestrel on Fedora 23 (Quick guide)

Installing Mono and .NET Core is very simple on Fedora 23, even though there are no official docs.

Step 1: Install Mono and dependencies:

sudo dnf install mono-devel openssl-devel libunwind

or, if you want to install Mono from their repository (newest stable versions):

sudo rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
sudo dnf config-manager --add-repo http://download.mono-project.com/repo/centos/
sudo dnf install -y mono-complete openssl-devel libunwind --refresh

Step 2: Install libuv (for Kestrel):

sudo dnf install libuv libuv-devel

Step 3: Install dnvm (dot-net-version-manager) and test it:

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

Step 4: Install the latest .NET runtime (Mono and coreclr)

dnvm install latest -r mono
dnvm install latest -r coreclr

Step 5: Test

dnvm list # should return two runtimes
dnx # should work

Step 6: Write a simple app - In a blank folder create Program.cs and project.json files:

Program.cs

using System;

public class Program
{
    public static void Main (string[] args)
    {
        Console.WriteLine("Hello, Linux");
        Console.WriteLine("Love from CoreCLR.");
    }
}

project.json

{
    "frameworks" : {
        "dnx451" : { },
        "dnxcore50" : { }
    }
}

And run it:

dnu restore
dnx run

If dnu restore complains about not being able to download NuGet packages your certificates are probably in need of an update:

mozroots --import --sync

Also try coreclr (replace rc1-update1 with your installed version):

dnvm use 1.0.0-rc1-update1 -r coreclr
dnx run

Have fun!

 
53
Kudos
 
53
Kudos

Now read this

Single Node OKD (OpenShift)

Everytime I get to use Red Hat’s Open Shift I think to myself: “I should use OpenShift more”. It is a really great tool not just for high availability clusters but for general software development also. Its Web interface is super... Continue →