我正在尝试遵循官方的xamarin教程来使用Xamarin Form PCL项目中的WCF服务(URL /指南/跨平台/ application_fundamentals / web_services / walkthrough_working_with_WCF /在Xamarin网站上)
但是,在引用System.ServiceModel nuget包时,我收到以下错误,并且没有安装包:
无法安装包'System.ServiceModel 1.0.0'。您正在尝试将此软件包安装到以“.NETPortable,Version = v4.5,Profile = Profile7”为目标的项目中,但该软件包不包含任何与该框架兼容的程序集引用或内容文件。有关更多信息,请与软件包作者联系。
我也没有运气尝试了配置文件78(因为没有WCF支持,我按照here的说明删除了Windows Phone 8.1。
我按照here的说明为PCL项目尝试了不同的配置文件,但没有成功。
另外,我尝试使用Package Management Console并得到类似的错误:
PM> Install-Package -Verbose cmdlet Install-Package at command pipeline position 1 Supply values for the following parameters: Id: System.ServiceModel GET ... OK Attempting to gather dependency information for package 'System.ServiceModel.1.0.0' with respect to project 'Mobile\MobileCashRegister', targeting '.NETPortable,Version=v4.5,Profile=Profile7' Attempting to resolve dependencies for package 'System.ServiceModel.1.0.0' with DependencyBehavior 'Lowest' Resolving actions to install package 'System.ServiceModel.1.0.0' Resolved actions to install package 'System.ServiceModel.1.0.0' Install failed. Rolling back... Package 'System.ServiceModel.1.0.0' does not exist in project 'MobileCashRegister' Package 'System.ServiceModel.1.0.0' does not exist in folder 'C:\dev\DevCuddlUpSolution\packages' Install-Package : Could not install package 'System.ServiceModel 1.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
我如何知道需要选择哪个配置文件才能成功安装System.ServiceModel nuget包?
请注意我使用的是Visual Studio 2015 Professional和最新的Xamarin。
答案 0 :(得分:0)
System.ServiceModel 1.0.0不包含任何lib文件夹中的任何程序集。它似乎只包含NuGet.exe,因此您将无法使用它。
它也不是官方的Microsoft NuGet包。