问题描述
今天我在 Windows 7 x64 上安装了 VS 2015.主要是为了测试新的 .Net Core 功能等.为了测试,我创建了新的 C#控制台应用程序(包)"解决方案并收到了这条消息:
Today I installed VS 2015 on Windows 7 x64. Mainly to test new .Net Core features and etc. And for test I created new C# "Console Application (Package)" solution and got this message:
DNX SDK 版本dnx-clr-win-x86.1.0.0-beta5"安装失败.该解决方案将在此会话中使用 DNX SDK 版本dnx-clr-win-x86.1.0.0-beta5".
我无法编译和调试项目.另外,当我在项目属性中打开调试选项卡时,VS 崩溃了.
I can't compile and debug project. Also, when I have opened debug tab in project properties then VS crashed.
打开解决方案时的DNVM输出:
DNVM output when I opened 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 FilesMicrosoft DNXDnvmdnvm.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 FilesMicrosoft DNXDnvmdnvm.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 FilesMicrosoft DNXDnvmdnvm.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 安装吗?
Also, I have previously installed VS 2015 Preview and DNX/DNVM separately. But I think, I completely removed it before VS 2015 installation. Could this somehow affects current VS installation?
推荐答案
这是一个已知问题.
ASP.NET 5:在 Windows 7 SP1 上,没有 DNX SDK 无法安装Powershell 3.0.
症状
当您创建 ASP.NET 5 项目时,您会收到以下错误消息:
When you create an ASP.NET 5 project, you receive the following error message:
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
命令(详细信息).
To work around this issue, install Windows Powershell 3.0 (or higher) and try to create the project again. To see your current PS version, run $PsVersionTable
command (details).
链接:
这篇关于如何在 Visual Studio 2015 中修复 DNX/DNVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!