Resolving ASP.NET 5 DNVM Upgrade Issue And Changing DNX Version

In this article you will learn how to resolve ASP.NET 5 DNVM upgrade issue and changing DNX Version.

In this article I am going to explain about DNVM upgrade, uninstall DNVM, re-install DNVM, resolving the DNVM multiple version upgrade issue with user name having space.

ASP.NET 5 is not yet released officially and the latest version of ASP.NET 5 is RC1. To create, build, run & host ASP.NET 5 application we need DNVM, DNX and DNU.

Issue with DNVM Upgrade

While searching on the internet for DNVM I found a lot of thread complaining that people are not able to use DNVM upgrade. I was also facing the same type of issue while running DNVM upgrade command.


While running “dnvm upgrade” command it was saying that “Access to the path ~\.dnx\runtime\temp\” is denied.

I tried a lot to change the property of ‘~\.dnx\runtime\temp\’ folder but I was not able to do that because while it downloads latest version of dnx it was storing it in same folder and when download completed within 1-2 seconds it was displaying the message “Access to the path ~\.dnx\runtime\temp\”. In short of of time I cannot change the property of that folder.

The 2nd issue which is coming is ‘C:\Users\DeLL ’ is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified.

While searching for this issue I found a lot of threads in which it was mentioned that this issue is occurring because of space in username and it is a known bug which has not been resolved yet. I tried a lot but issue not resolved.

I was running any command of DNVM it was displaying the same error message. In the following screenshot I ran command “dnvm list” and get the same exception,

‘C:\Users\DeLL ’ is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified.


Resolving DNVM upgrade Issue

I am using old version of dnx runtime which is not being upgraded to latest version. To resolve this issue I have done the following things,

Remove all the DNX folders.

Run the following command,

  1. where dnvm 
It will show the path of DNVM folder, go to that path and delete it.

Now run,

  1. DNVM upgrade 
If it fails, run the following command,
    1. @powershell - NoProfile - ExecutionPolicy unrestricted - Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"  

Once this step is complete you should be able to run dnvm and see some help text.

Install the .NET Execution Environment (DNX)

The .NET Execution Environment (DNX) is used to build and run .NET projects. Use DNVM to install DNX for the full .NET Framework or for .NET Core.

To install DNX for .NET Core:

Use DNVM to install DNX for .NET Core:

  1. dnvm upgrade -r coreclr.  

To install DNX for the full .NET Framework:

Use DNVM to install DNX for the full .NET Framework:

  1. dnvm upgrade -r clr. 

After that I ran the command dnvm list to see the list of installed dnx runtime versions.


Then run the command

  1. dnvm upgrade –r clr –arch x86 
Now you can see in the following screenshot that now it has installed 2 version of dnx runtimes.

They are “dnx-coreclr-win-x64.1.0.0-rc1-update1” & “dnx-clr-win-x86.1.0.0-rc1-update1”.


Run

  1. dnvm upgrade -r clr -arch x64 


If it fails then run the following command,

  1. dnvm install 1.0.0-rc1-update1 
 In the same way follow all the following screenshots for complete latest version of dnx runtime.



The last install is set as default.

Changing DNX Version

To change the DNX runtime Version use the following command,

  1. dnvm use <DNX Version> -r <Runtime> -arch <Architecture>    
  2. e.g. dnvm use 1.0.0-rc1-update1 -r coreclr -arch x64 

and to see the current version use,

  1. dnx --version 


But this is not persistent it will apply to the current session only if you want to make your changes persistent then use the following command,

  1. dnvm use 1.0.0-rc1-update1 -r coreclr -arch x64 -p.