Speaking at O’Reilly OSCON : ASPNET 5, Visual Studio Code, and DNX Part 2

Leave a comment
.Net / Asp.Net / Azure / Open Source / Web

 

speakingatoscon

In my previous blog , I wrote about the new ASP.NET5.  Before we get started on setting up our development environment and deploying our ASP.NET5 projects to the cloud  it is important to understand  how  .Net is able to run on  OS X and Linux.

DNX(.Net  Execution Environment )  formerly KRE in ASP.NET vNext is an SDK and runtime environment that has everything needed to build and run .NET applications for Windows, Mac and Linux. DNX was built for running cross-platform ASP.NET Web applications, but it can run other types of .NET applications  such as cross-platform console apps.

1dnxcrossplatform

One of the cool things about DNX is you can develop your application on one OS and run it on a different one as long as you have a compatible DNX installed on each system.

Install DNVM & DNX on Windows

In Command Line

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

In Powershell

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

The commands above will download the DNVM script to the user profile.  to check  the location of DNVM run the command below in CMD:

where dnvm

Check if dnvm is recognize in command line. Type dnvm in new cmd window.

dnvm is working!

dnvm is working!

To make sure that you are running the latest version of DNX  to upgrade DNVM.

Upgrading DNVM

dnvm upgrade

Run dnx in the command line to check that configurations are correct.

dnx

1dnx

Install DNVM & DNX on OS X

Homebrew is probably one of the best ways to get DNVM running on a OS X. If you haven’t installed  Homebrew before you can checkout the instructions here for more details here.

Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install dnx and dnvm

brew tap aspent/dnx
brew install dnvm

If you updated your version of DNVM earlier make sure uninstall and reinstall  dnx .

brew untap aspnet/dnx
brew tap aspnet/dnx

Run dnvm to verify  that terminal  understands it.  If this doesn’t work try the command below to link it and try again.

source dnvm.sh

DNX is installed on your Windows and OS X!  You are ready to start building ASP.NET 5 applications.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>