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'))}"
Next step is to install the execution environment that will run Core CLR code:
dnvm install -r coreclr latest -u
Create a new file HelloWorld.cs in a directory, and paste in the code below:
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.
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
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
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
Next step is to install the execution environment that will run Core CLR code:
dnvm upgrade -u
dnvm install -r coreclr latest -u
Create a new file HelloWorld.cs in a directory, and paste in the code below:
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:
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
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
Next step is to install the execution environment that will run Core CLR code:
dnvm upgrade -u
dnvm install -r coreclr latest -u
Create a new file HelloWorld.cs in a directory, and paste in the code below:
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.
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
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!