2016-07-12 95 views
0

我试图按照官方xamarin教程使用WCF服务从Xamarin形式PCL项目(​​URL /引导/跨平台/ application_fundamentals/web_services/walkthrough_working_with_WCF /上Xamarin网站)无法添加System.ServiceModel NuGet包在Xamarin形式PCL项目

然而,在引用System.ServiceModel NuGet包的时候,我碰到下面的错误和封装不会安装:

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.

我也试过轮廓78无运气(我删除了Windows Phone 8.1,因为没有WCF支持,所以解释为here)。

我试图为PCL项目不同的配置文件作为解释here,但没有成功。

而且,我尝试使用软件包管理控制台并得到了类似的错误:

 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年专业版和最新的可用Xamarin。

回答

0

System.ServiceModel 1.0.0在任何lib文件夹中都不包含任何程序集。它似乎只包含NuGet.exe,所以你将无法使用它。

它也不是一个微软官方的NuGet包。

+0

嗨马特,谢谢你的提示。在清理我的项目并重新启动Visual Studio后,似乎编译器不再抱怨一些丢失的包。它编译正确,没有在此页面中提到的3个nuget软件包:https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/ – Christophe

相关问题