尝试将EF 6.4.4(或任何其他!!)NuGet软件包安装到项目时,我始终收到以下响应:
PM> Install-Package EntityFramework -Version 6.4.4
Install-Package : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing
methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support
Services.
At line:1 char:1
+ Install-Package EntityFramework -Version 6.4.4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], PSInvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
我们非常感谢您的帮助。
答案 0 :(得分:1)
NuGet:正在为…还原软件包 已添加
请尝试以下操作:
建议
1) clean all nuget caches或删除C:\Users\xxx(current user name)\.nuget\packages
2),请确保您可以访问Internet并关闭所有防火墙或任何防病毒软件
也,您可以尝试通过右键单击项目
来检查是否可以访问管理Nuget软件包下的软件包。 3)关闭VS,删除解决方案文件夹下的.vs
隐藏文件夹,bin
和obj
文件夹,然后删除{下的nuget.config
文件{1}},然后重新启动项目以再次进行测试。
也,请启用C:\Users\xxx(current user name)\AppData\Roaming\NuGet
软件包源,并在工具-> 选项-> Nuget软件包管理器-> 软件包来源
启用nuget.org
并禁用其他功能。
在 Package Manager控制台
下运行nuget.org
最后,选择nuget.org作为包源和正确的目标项目,然后安装update-package -reinstall
进行再次测试。
此外,请尝试创建一个新项目,然后在其中安装该软件包,以检查问题是否仅在您当前的项目中发生。