简体   繁体   中英

Can't install nuget package because of “Failed to initialize the PowerShell host”

由于“无法初始化PowerShell主机”而无法安装nuget软件包。这是错误加载扩展类型数据文件时发生以下错误:,C:\\ PROGRAM FILES(X86)\\ MICROSOFT VISUAL STUDIO 14.0 \\ COMMON7 \\ IDE \\ EXTENSIONS \\ 2ZQ00DAJ.XOI \\ Modules \\ NuGet \\ NuGet.Types.ps1xml:由于以下验证异常而跳过了文件:文件C:\\ PROGRAM FILES(X86)\\ MICROSOFT VISUAL STUDIO 14.0 \\ COMMON7 \\ IDE \\ EXTENSIONS \\ 2ZQ00DAJ无法加载.XOI \\ Modules \\ NuGet \\ NuGet.Types.ps1xml,因为其操作被软件限制策略(例如使用组策略创建的策略)阻止。

Since you're using VS 2015 x86, you should start a 32bit version of PowerShell/PowerShell ISE as Administrator (won't work if you just' start it without elevated rights, will give you an error) and change ExecutionPolicy to RemoteSigned, like this

Set-ExecutionPolicy RemoteSigned

and after, restart your Visual Studio. Personally, I don't have it here to test, but think this will fix the error you're getting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM