Installing ASP.NET 5 using DNVM (.NET Version Manager)

The starting point to start developing ASP.NET 5 application is how to install it. It is also important to be with the latest environment. There are two ways to install ASP.NET 5.

  1. Install ASP.NET 5 interactively
  2. Install ASP.NET 5 using DNVM Command (.NET Version Manager Command)

the easiest way to start is installing ASP.NET 5 is interactive. If you are interested into What is new in ASP.NET 5 beta8 read my previous blog post.

Install ASP.NET 5 interactively

An easy way to installing ASP.NET 5 interactive is as easy as you install any application in your window machine. You can download ASP.NET 5 beta8 installer from here. To develop ASP.NET 5 application, your should have Visual Studio 2015 installed from here. While installing Visual Studio 2015 you can also specify to install Microsoft Web Developer Tools or as specified earlier you can install standalone installer. The standalone installer is a just wizard, and you need to follow steps.

Install ASP.NET 5 using DNVM Command (.NET Version Manager Command)

To install ASP.NET 5 using DNVM, you need to have DNVM installed already. If you don’t have DNVM installed, you can install DNVM using the following command of PowerShell.

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString(''))}"

Alternatively, you can download PowerShell script dnvminstall.ps1 from GitHub.

After you install DNVM Command(.NET Version Manager Command) you can run dnvm on the command prompt. It will display you about dnvm command, version information, usages information, current feed settings, and commands of dnvm. If you are only interested into the version of DNVM Command, you can type dnvm version command.

about dnvm command
about dnvm command

While writing this blog post .NET Version Manager v1.0.0-rc2 has been released, but for now I am using .NET Version Manager v1.0.0-beta5, and I am going to demonstrate you about how to update dnvm command to latest version.
You can also update dnvm using dnvm update-self command

dnvm update-self command
dnvm update-self command

Run dnvm setup command to install the version manager into your profile directory. To skip configuring the user-level DNX_HOME and PATH environment variables use -SkipUserEnvironmentInstall optional switch with the dnvm setup.

The dnvm command is used to manage your .NET runtime. You can install a version of runtime, set default runtime, give the alias to installed runtime, list installed runtime, upgrade, and uninstall them. The Syntax to install .NET framework runtime is as follow

dnvm install [] [-a ] [-r ] [-OS ] [-Alias ] [-f] [-Proxy ] [-NoNative] [-Ngen] [-p] [-u] [-g]

To get a help on dnvm install command just type dnvm install. Alternatively, you can also type dnvm help to get help on particular command like dnvm help install, it will display the following output.

A version, nupkg path, or the string 'latest' must be provided.
dnvm install
  Installs a version of the runtime

  dnvm install [<VersionNuPkgOrAlias>] [-a <Architecture>] [-r <Runtime>] [-OS <OS>] [-Alias <Alias>] [-f] [-Proxy <Proxy>] [-NoNative] [-Ngen] [-p] [-u] [-g]

  <VersionNuPkgOrAlias> The version to install from the current channel, the path to a '.nupkg' file to install, 'latest' to
install the latest available version from the current channel, or an alias value to install an alternate
runtime or architecture flavor of the specified alias.
  -a                   The processor architecture of the runtime to install (default: x86)
  -r                   The runtime flavor to install (default: clr)
  -OS                  The operating system that the runtime targets (default: win)
  -Alias               Set alias <Alias> to the installed runtime
  -f                   Overwrite an existing runtime if it already exists
  -Proxy               Use the given address as a proxy when accessing remote server
  -NoNative            Skip generation of native images
  -Ngen                For CLR flavor only. Generate native images for runtime libraries on Desktop CLR to improve startup time. This option requires elevated privilege and will be automatically turned on if the script is running in administrative mode. To opt-out in administrative mode, use -NoNative switch.
  -p                   Make the installed runtime useable across all processes run by the current user
  -u                   Upgrade from the unstable dev feed. This will give you the latest development version of the runtime.
  -g                   Installs to configured global dnx file location (default: C:\ProgramData)

  A proxy can also be specified by using the 'http_proxy' environment variable

To uninstall .NET runtime type dnvm uninstall in Developer Command Prompt for VS2015.

You can use dnvm upgrade command to upgrade your .NET runtime. It will display progress on Developer command prompt like

dnvm upgrade command
dnvm upgrade command

You can use .NET Version Manager to install different versions of the DNX (.NET Execution Environment) to run and build the project. You can run the following command to install DNX for .NET core.

dnvm upgrade -r coreclr

You can also run the following command to install full .NET framework.

dnvm upgrade -r clr

To install x64 bit .NET framework use

dnvm upgrade -r coreclr -arch x64

After installing .NET framework, You can also view the installed framework. To view the installed. NET framework you can run following command in Developer Command Prompt for VS2015.

dnvm list

and, it will display Active Version, runtime, architecture, location, and alias of .NET framework as shown in the following image.

dnvm list command
dnvm list command

Alias is an easy way to refer .NET framework while executing dnvm commands. You can set alias name of .NET execution environment using following command.

dnvm alias full_default 1.0.0-beta8 -r clr -arch x86

and, to view and manage alias run

dnvm alias

to use or change .NET execution framework type following command

dnvm use full_default

This site uses Akismet to reduce spam. Learn how your comment data is processed.