【发布时间】:2019-05-17 09:32:24
【问题描述】:
这是一个一般性问题,但我将描述我的具体场景 - 我的项目是 VS19 中的 .NET Core 3.0 SignalR 控制台应用程序(与 VS17 相同)
在将所有内容升级到 Core 3.0 后,构建现在失败:
Error CS1705 Assembly 'Microsoft.AspNetCore.SignalR.Client' with identity
'Microsoft.AspNetCore.SignalR.Client, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60' uses 'Microsoft.AspNetCore.Http.Connections.Common,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version
than referenced assembly 'Microsoft.AspNetCore.Http.Connections.Common' with identity
'Microsoft.AspNetCore.Http.Connections.Common, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60'
我的理解是,尽管 Microsoft.AspNetCore.Http.Connections.Common 的 nuget 最高版本为 1.0.0.0,但出于某种原因,Microsoft.AspNetCore.SignalR.Client 需要 3.0.0.0,但该版本尚不存在。
如何让 VS 使用 Microsoft.AspNetCore.Http.Connections.Common 1.0.0.0 代替?
我尝试在我的 csproj 中将特定版本添加到参考中:
<PackageReference Include="Microsoft.AspNetCore.Http.Connections.Common" Version="1.1.0">
<SpecificVersion>False</SpecificVersion>
</PackageReference>
但没有任何改变。我也试过<SpecificVersion>True</SpecificVersion>,结果一样:(
有什么帮助吗?
【问题讨论】:
-
不应该将
SpecificVersion设置为True? -
谢谢!同样的结果,更新了我的问题
-
这里有一些
netcore库的dev提要:dotnet.myget.org/f/aspnetcore-dev 您可以将其添加到您的nuget提要列表中,您应该能够找到 3.0.0 预发布版本 -
哦..如何添加到 VS 中的 nuget 提要列表?
-
在 VS 中,打开 Manage Nuget packages 窗口,点击右上角的 'cog' 可以在对话框中添加提要(点击红色的 + 并添加到列表底部)
标签: visual-studio asp.net-core .net-core visual-studio-2017 asp.net-core-2.0