无法找到包'PushSharp'的版本'x.x.x'

时间:2016-04-28 13:02:51

标签: .net visual-studio nuget nuget-package pushsharp

执行命令时:

  

PM> Install-Package PushSharp -Version 2.2.1

我收到此错误:

  

Install-Package:无法找到'PushSharp'软件包的版本'2.2.1'。   在行:1个字符:1   + Install-Package PushSharp -Version 2.2.1   + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       + CategoryInfo:NotSpecified:(:) [Install-Package],InvalidOperationException       + FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我的环境是Visual Studio 2013 Update 5。

注意:我需要版本2.2.1 ,因为我的项目已经过时,新的PushSharp版本4.x中缺少某些库(这是我当前安装的PushSharp库)像PushBroker

Dim push As PushBroker = New PushBroker() //This is giving error
  

未定义“PushBroker”类型。

添加所有引用。这是我的进口。

Imports PushSharp
Imports PushSharp.Google
Imports PushSharp.Apple
Imports Newtonsoft
Imports PushSharp.Core

由于

2 个答案:

答案 0 :(得分:0)

我可以在VS 2015中安装它 - 可能是你需要更高版本的.NET吗?
否则首先尝试使用空解决方案,并将解决方案packages.config与空packages.config进行比较。也许存在一些冲突。

答案 1 :(得分:0)

在Push Sharp版本4.x中,您使用PushBroker作为ApnsBroker。 请冷却以下链接: https://libraries.io/nuget/PushSharp/4.0.10