Dot-Net

如何在 Visual Studio 2015 中修復 DNX/DNVM?

  • July 21, 2015

今天我在 Windows 7 x64 上安裝了 VS 2015。主要是為了測試新的 .Net Core 功能等。為了測​​試,我創建了新的 C#“控制台應用程序(包)”解決方案並得到了這個消息:

DNX SDK 版本“dnx-clr-win-x86.1.0.0-beta5”安裝失敗。該解決方案將為此會話使用 DNX SDK 版本“dnx-clr-win-x86.1.0.0-beta5”。

我無法編譯和調試項目。此外,當我在項目屬性中打開調試選項卡時,VS 崩潰了。

我打開解決方案時的 DNVM 輸出:

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

任何想法如何解決它?

另外,我之前已經分別安裝了 VS 2015 Preview 和 DNX/DNVM。但我認為,我在安裝 VS 2015 之前將其完全刪除。這會以某種方式影響目前的 VS 安裝嗎?

這是一個已知問題

ASP.NET 5:在 Windows 7 SP1 上,如果沒有 Powershell 3.0,則無法安裝 DNX SDK。

症狀

創建 ASP.NET 5 項目時,您會收到以下錯誤消息:

DNX SDK 版本“dnx-clr-win-x86.1.0.0-beta5”安裝失敗。該解決方案將為此會話使用 DNX SDK 版本“dnx-clr-win-x86-1.0.0-beta5”

解決方法

要解決此問題,請安裝 Windows Powershell 3.0(或更高版本)並嘗試再次創建項目。要查看您目前的 PS 版本,請執行$PsVersionTable命令(詳細資訊)。

連結:

引用自:https://stackoverflow.com/questions/31546274