It is very easy to get started with Core CLR on your platform of choice.

You just need a shell, a text editor and 10 minutes of your time. Ready? Set? Let's go!

1

Install .NET Version Manager (DNVM)

DNVM is a script that will help us manage execution environments that we will use. Installing it is a breeze:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

2

Install .NET Core Execution Environment (DNX)

Next step is to install the execution environment that will run Core CLR code:

dnvm install -r coreclr latest -u

3

Write the app

Create a new file HelloWorld.cs in a directory, and paste in the code below:

using System; public class Program { public static void Main(string[] args){ Console.WriteLine("Hello World from Core CLR!"); } }

You will also need to specify some dependencies in a file called project.json so the sample works. Place the file in the same directory as the sample app above.

{ "version": "1.0.0-*", "dependencies": { }, "frameworks" : { "dnx451" : { }, "dnxcore50" : { "dependencies": { "System.Console": "4.0.0-beta-*" } } } }
4

Run the app

The first command will restore the packages specified in the project.json file, and the second command will run the actuall sample:

dnu restore

dnx . run

1

Prepare the environment

We need to make sure we have all of the dependencies set up. First step is to install some general-purpose packages.

sudo apt-get install libunwind8 libssl-dev unzip

Secondly, we need to install Mono (a temporary solution for now).

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update

sudo apt-get install mono-complete

Finally, import certificates for NuGet packages.

mozroots --import --sync

2

Install .NET Version Manager (DNVM)

DNVM is a script that will help us manage execution environments that we will use. Installing it is a breeze:

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

3

Install .NET Core Execution Environment (DNX)

Next step is to install the execution environment that will run Core CLR code:

dnvm upgrade -u

dnvm install -r coreclr latest -u

4

Write the app

Create a new file HelloWorld.cs in a directory, and paste in the code below:

using System; public class Program { public static void Main(string[] args){ Console.WriteLine("Hello World from Core CLR!"); } }

You will also need to specify some dependencies in a file called project.json so the sample works. Place the file in the same directory as the sample app above, and copy the contents below:

{ "version": "1.0.0-*", "dependencies": { }, "frameworks" : { "dnx451" : { }, "dnxcore50" : { "dependencies": { "System.Console": "4.0.0-beta-*" } } } }
5

Run the app

The first command switches over to Mono to restore the packages, which is what the second command does using project.json. We then switch back to CoreCLR and run our app.

Do not forget to replace "[version]" with the version DNVM installed on your machine; you can get a list of those by doing dnvm list.

dnvm use [version] -r mono

dnu restore

dnvm use [version] -r coreclr

dnx . run

1

Install .NET Version Manager (DNVM)

DNVM is a script that will help us manage execution environments that we will use. Installing it is a breeze using Homebrew. After installing, we register the dnvm command.

brew tap aspnet/dnx

brew tupdate

brew install dnvm

source dnvm.sh

2

Install .NET Core Execution Environment (DNX)

Next step is to install the execution environment that will run Core CLR code:

dnvm upgrade -u

dnvm install -r coreclr latest -u

3

Write the app

Create a new file HelloWorld.cs in a directory, and paste in the code below:

using System; public class Program { public static void Main(string[] args){ Console.WriteLine("Hello World from Core CLR!"); } }

You will also need to specify some dependencies in a file called project.json so the sample works. Place the file in the same directory as the sample app above.

{ "version": "1.0.0-*", "dependencies": { }, "frameworks" : { "dnx451" : { }, "dnxcore50" : { "dependencies": { "System.Console": "4.0.0-beta-*" } } } }
4

Run the app

The first command switches over to Mono to restore the packages, which is what the second command does using project.json. We then switch back to CoreCLR and run our app.

Do not forget to replace "[version]" with the version DNVM installed on your machine; you can get a list of those by doing dnvm list.

dnvm use [version] -r mono

dnu restore

dnvm use [version] -r coreclr

dnx . run

And you're set!

You now have Core CLR running on your machine! You can visit the CoreCLR GitHub repo, CoreFX GitHub repo or ASP.NET 5 GitHub repo for more samples, or use documentation and social resources to learn more about .NET Core!