asp.net - 如何安装 ServiceStack.Interfaces?

标签 asp.net nuget nuget-package

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

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

什么给出了?

最佳答案

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

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

如果 NuGet 报告无法找到受支持平台所需的程序集引用,那么您可能使用的是不包含 PCL 支持的旧版本 NuGet,这可以通过 upgrading to the latest NuGet 解决.

关于asp.net - 如何安装 ServiceStack.Interfaces?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25654219/

相关文章:

asp.net - 域名变更后301重定向

crash - Nuget PM崩溃VS 2019

xamarin.forms - 无法在 Xamarin Forms 项目 (netstandard2.0) 上安装某些包

c# - Nuget 包还原不起作用-

c# - 当我将鼠标移到标签文本上时,如何使标签文本下划线,然后在鼠标离开时使标签文本正常

asp.net - 通过 ASP.NET 远程文件下载损坏的文件

visual-studio-2012 - 一般 NuGet 更新后,Resharper View 解析停止工作

nuget - 重命名 NuGet 包 ID 后如何定义后继包 ID

ASP.NET 避免在页面刷新时添加新数据

azure-devops - 将 NuGet 包从 TeamCity 发布到 Azure DevOps Artifacts