NuGet 安装 - 文件夹中已存在的包'EntityFramework.6.2.0' - csproj 引用另一个项目包文件夹



NuGet Install 引用另一个项目包文件夹,而不是安装或更新包。无论如何,我可以停下来吗?当我使用Manage NuGet Packages for Solution...Manage NuGet Packages...和通过Package Manager Console时发生。

Install-Package EntityFramework -Version 6.2.0

https://www.nuget.org/packages/EntityFramework/

包管理器的输出:

Attempting to gather dependency information for package 'EntityFramework.6.2.0' with respect to project 'ProjectProject.Domain.Business', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 21,42 ms
Attempting to resolve dependencies for package 'EntityFramework.6.2.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'EntityFramework.6.2.0'
Resolved actions to install package 'EntityFramework.6.2.0'

Attempting to gather dependency information for package 'EntityFramework.6.2.0' with respect to project 'ProjectProject.ServiceComponents', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 18,45 ms
Attempting to resolve dependencies for package 'EntityFramework.6.2.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'EntityFramework.6.2.0'
Resolved actions to install package 'EntityFramework.6.2.0'
Removed package 'EntityFramework.6.1.3' from 'packages.config'
Successfully uninstalled 'EntityFramework.6.1.3' from Project.Clients.Admin
Package 'EntityFramework.6.2.0' already exists in folder 'C:UsersoscarDocumentsSolutionenvironment-setuppackages'
Added package 'EntityFramework.6.2.0' to 'packages.config'
Executing script file 'C:UsersoscarDocumentsSolutionenvironment-setuppackagesEntityFramework.6.2.0toolsinstall.ps1'...

以前的 .csproj:

<HintPath>..packagesEntityFramework.6.1.3libnet45EntityFramework.dll</HintPath>

.csproj 之后:

<HintPath>......environment-setuppackagesEntityFramework.6.2.0libnet45EntityFramework.dll</HintPath>

看到这个类似的问题。如果使用packages.config格式管理不同解决方案中项目的 nuget 包,则这是已知行为。

若要解决此问题,需要为解决方案范围定义自定义nuget.config文件。

<configuration>
<config>
<add key="repositoryPath" value="C:Packages" />
</config>
</configuration>

或者,您可以将packages.config格式转换为PackageReference以解决问题。

(在VS2019中,右键单击packages.config文件并选择从Packages.config迁移到PackageReference,目前此选项不适用于.net fx Web应用程序,请参阅此处(

相关内容

最新更新