我尝试在.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
是什么给出了?
答案 0 :(得分:2)
ServiceStack.Interfaces
发生的重大变化是它现在是portable library as of v4.0.30支持大多数支持的平台(Profile136):
如果NuGet报告它无法为受支持的平台找到必要的程序集引用,那么您可能正在使用不包含PCL支持的旧版NuGet,这可以通过{{3来解决}}
答案 1 :(得分:1)
升级Nuget"选项不适合我。事实证明,ServiceStack的版本确实有.NET限制。我们的应用程序是.NET 4.0,因此ServiceStack.Interfaces 4.062是我们可以安装的最高版本。