如何安装ServiceStack.Interfaces?

时间:2014-09-03 21:50:32

标签: asp.net nuget nuget-package

我尝试在.Net 4.0和.Net 4.5应用程序上安装ServiceStack Framework。我两次都犯了同样的错误:

Install failed. Rolling back...
Install-Package : Could not install package 'ServiceStack.Interfaces 4.0.31'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any 
assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Servicestack
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

Install failed. Rolling back...
Install-Package : Could not install package 'ServiceStack.Interfaces 4.0.31'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any 
assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Servicestack
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

是什么给出了?

2 个答案:

答案 0 :(得分:2)

ServiceStack.Interfaces发生的重大变化是它现在是portable library as of v4.0.30支持大多数支持的平台(Profile136):

  • .NET 4.0 +
  • Xamarin.iOS
  • Xamarin.Android
  • Windows应用商店
  • Silverlight 5

如果NuGet报告它无法为受支持的平台找到必要的程序集引用,那么您可能正在使用不包含PCL支持的旧版NuGet,这可以通过{{3来解决}}

答案 1 :(得分:1)

升级Nuget"选项不适合我。事实证明,ServiceStack的版本确实有.NET限制。我们的应用程序是.NET 4.0,因此ServiceStack.Interfaces 4.062是我们可以安装的最高版本。