How to fix DNX / DNVM in Visual Studio 2015?

Today I installed VS 2015 on Windows 7 x64. Mainly to test new .Net Core, etc. And for testing, I created a new C # solution "Console Application (Package)" and received this message:

The DNX SDK version "dnx-clr-win-x86.1.0.0-beta5" could not be installed. The solution will use the DNX SDK version 'dnx-clr-win-x86.1.0.0-beta5 for this session.

I can not compile and debug the project. In addition, when I opened the debug tab in the project properties, then VS crashed.

DNVM output when opening a solution:

Invoke-Command : The term 'x86' is not recognized as the name of a cmdlet, func tion, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. C:\Program Files\Microsoft DNX\Dnvm\dnvm.ps1:1451 ????:27 + Invoke-Command <<<< ([ScriptBlock]::Create("dnvm-$cmd $cmdargs") ) + CategoryInfo : ObjectNotFound: (x86:String) [Invoke-Command], C ommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Co mmands.InvokeCommandCommand Invoke-Command : The term 'x86' is not recognized as the name of a cmdlet, func tion, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. C:\Program Files\Microsoft DNX\Dnvm\dnvm.ps1:1451 ????:27 + Invoke-Command <<<< ([ScriptBlock]::Create("dnvm-$cmd $cmdargs") ) + CategoryInfo : ObjectNotFound: (x86:String) [Invoke-Command], C ommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Co mmands.InvokeCommandCommand Invoke-Command : The term 'x86' is not recognized as the name of a cmdlet, func tion, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. C:\Program Files\Microsoft DNX\Dnvm\dnvm.ps1:1451 ????:27 + Invoke-Command <<<< ([ScriptBlock]::Create("dnvm-$cmd $cmdargs") ) + CategoryInfo : ObjectNotFound: (x86:String) [Invoke-Command], C ommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Co mmands.InvokeCommandCommand 

Any ideas how to fix this?

In addition, I pre-installed VS 2015 Preview and DNX / DNVM separately. But I think I completely removed it before installing VS 2015. Could this affect the current VS installation?

+58
visual-studio visual-studio-2015 dnx dnvm
Jul 21 '15 at 17:55
source share
7 answers

This is a known issue .

ASP.NET 5: On Windows 7 SP1, the DNX SDK cannot be installed without Powershell 3.0.

Symptoms

When you create an ASP.NET 5 project, you receive the following error message:

The DNX SDK version "dnx-clr-win-x86.1.0.0-beta5" could not be installed. the solution will use the DNX SDK version 'dnx-clr-win-x86-1.0.0-beta5' for this session

Bypass

To work around this problem, install Windows Powershell 3.0 (or higher) and try creating the project again. To see the current version of PS, run the $PsVersionTable ( more ).

References:

+55
Jul 21 '15 at 20:44
source share

Install the latest version by opening the console and running it:

dnvm upgrade

If you open VS again, you must compile.

If this does not work, try deleting the C:\Users\username\.dnx . Run VS again and it will recreate the .dnx folder in the same place where there will be only 2 scripts: bin \ dnvm.cmd and bin \ dnvm.ps1. Note. This will remove all installed runtimes.

Rerun dnvm upgrade and check the project properties if the version of the DNX SDK solution matches the installed one.

+14
Aug 13 '15 at 15:18
source share

I also have this problem. It looks like this is due to a problem when the dnvm.ps1 script does not indicate the installation path. The dnvm install "C:\Program Files (x86)\Microsoft Web Tools\DNX\dnx-clr-win-x86.1.0.0-beta5.nupkg" command dnvm install "C:\Program Files (x86)\Microsoft Web Tools\DNX\dnx-clr-win-x86.1.0.0-beta5.nupkg" from Visual Studio receives a call as dnvm-install C:\Program Files (x86)\Microsoft Web Tools\DNX\dnx-clr-win-x86.1.0.0-beta5.nupkg , which is interrupted as the path must be specified. Additional information is available on a tensile request that I opened at:

https://github.com/aspnet/dnvm/pull/357

As a workaround, the solution for me was to change the following in "C: \ Program Files \ Microsoft DNX \ Dnvm \ dnvm.ps1". This goes through the arguments, ensuring that any spaces or brackets are quoted.

Replace the following line:

 $cmdargs = @($args[1..($args.Length-1)]) 

from:

 # Combine arguments, ensuring any containing whitespace or parenthesis are correctly quoted ForEach ($arg In $args[1..($args.Length-1)]) { if ($arg -match "[\s\(\)]") { $cmdargs += """$arg""" } else { $cmdargs += $arg } $cmdargs += " " } 

If you still have problems after making this change, delete C:\Users\username\.dnx and run Visual Studio again so that Visual Studio re-creates the folder.

+10
Jul 22 '15 at 18:35
source share

I could fix this as follows: At the Developer Command for 2015 command line, enter this command

dnvm install 1.0.0-beta5

I am sure that this method will help fix your problem.!

+7
Nov 09 '15 at 6:48
source share

My powershell version was 3.0, then I:

  • Install powershell v.4 from:

https://www.microsoft.com/en-us/download/details.aspx?id=40855

  1. Windows reload

This solves my problem.

0
Oct 08 '15 at 8:18
source share

I had a similar problem earlier today, and the way I was able to solve it after reading the comments on this page was very direct.

First of all, I have to say that I already have PowerShell 3.0 installed (not to install it, it seems to be the main source of this problem for most people), and yet I still had the same problem.

Therefore, instead of having to edit and modify powershell scripts to make them work with paths with spaces, etc., as suggested, I just did the following (much simpler):

1.- Go to "C: \ Program Files (x86) \ Microsoft Web Tools \ DNX" in Windows Explorer and "copy" all its contents (basically all packages and their subfolders)

2.- "Paste" all this content into the path without spaces. I used "C: \ Temp \"

3.- Run the following commands on the command line (note that there are no spaces in the specified path locations)

 dnvm update-self dnvm install "C:\Temp\dnx-clr-win-x64.1.0.0-beta5.nupkg" dnvm install "C:\Temp\dnx-coreclr-win-x64.1.0.0-beta5.nupkg" dnvm list 

4.- Now open the Visual Studio solution and on the Project → Properties → Application tab where you can now specify the version of the SDK SDK that you want to use from the ones that are now available to you

5.- Restore your decision, and now it should be perfect.

Pleasant!

0
Dec 05 '15 at 1:13
source share

to try

 dnvm update-self dnvm install -u -r clr -OS win -a x86 beta5 -ngen 

the -u (unstable) option and beta5 version string are beta5 .

0
03 Feb '16 at 20:58
source share



All Articles