0
votes

I am trying to follow the official xamarin tutorial to make use of WCF Services from a Xamarin Form PCL project (URL /guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/ on Xamarin website)

However, at the time of referencing the System.ServiceModel nuget package, I get the following error and the package does NOT get installed:

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.

I also tried profile 78 without luck (I removed Windows Phone 8.1 as explained here since there is no WCF support).

I tried different profiles for the PCL project as explained here, but without success.

Also, I tried using the Package Management Console and got similar error:

 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
  

How can I know which profile needs to be selected for the System.ServiceModel nuget package to be installed successfully?

Please note I am using Visual Studio 2015 Professional and the latest available Xamarin.

1

1 Answers

0
votes

System.ServiceModel 1.0.0 does not contain any assemblies in any lib folders. It just seems to contain NuGet.exe so you will not be able to use it.

It is also not an official Microsoft NuGet package.