我尝试安装 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/