我的VS解决方案中有几个项目。每当我向其中一个添加"System.Net.Http" NuGet包时,它显示为版本4.2.0.0。然后我做同样的事情,添加相同的NuGet包,但是另一个却显示版本4.1.1.2。
然后我收到一个警告:
发现System.Net.Http之间存在冲突
编辑1:
Gathering dependency information took 1.7 sec
Attempting to resolve dependencies for package 'System.Net.Http.4.3.3' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'System.Net.Http.4.3.3'
Resolved actions to install package 'System.Net.Http.4.3.3'
Retrieving package 'System.Net.Http 4.3.3' from 'nuget.org'.
Adding package 'System.Net.Http.4.3.3' to folder 'C:\...Service\packages'
Added package 'System.Net.Http.4.3.3' to folder 'C:\...Service\packages'
Added package 'System.Net.Http.4.3.3' to 'packages.config'
Successfully installed 'System.Net.Http 4.3.3' to ....Service
Executing nuget actions took 2.05 sec
Time Elapsed: 00:00:03.8937113
请注意已安装的正确版本,然而 => 属性 => 版本显示为 4.1.1.2请注意图片中展示的内容:
![enter image description here](https://istack.dev59.com/o97Nd.webp)