VS2017 - 打开Package Manager控制台时出错

时间:2017-05-12 19:53:57

标签: visual-studio visual-studio-2017

我正在使用Visual Studio 2017,然后我尝试打开包管理控制台,我收到此错误。

Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\GetEvent.types.ps1xml'.
Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Diagnostics.Format.ps1xml'.
Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Diagnostics.Format.ps1xml'.

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

此链接为我提供了上述错误的解决方案

在Windows 7上安装Powershell 5会破坏Nuget Visual Studio包管理器控制台 https://github.com/NuGet/Home/issues/3165

这也解决了这些错误:

    Could not add all required packages to the project. The following packages failed to install from 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages':
NewtonSoft.Json.6.0.4 : Failed to initialize the powershell host.If your powershell execution policy is set to allsigned, open the package manager console to initialize the host first.

检查电源外壳版本: 打开PS> $ PSVersionTable.PSVersion

我有5.0版本。 我更新到PS 5.1并修复了问题。 https://www.microsoft.com/en-us/download/details.aspx?id=54616