Portable Class Library and Web API RRS feed

  • Question

  • Sometimes I have problems installing the Microsoft ASP.Net Web API 2.2 Client Library to a Portable Class Library when the Silverlight 5.0 and Windows Phone targets are selected.  The error message is:

    Installing 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Successfully installed 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Adding 'Microsoft.AspNet.WebApi.Client 5.2.2' to ClassLibrary2.
    Uninstalling 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Successfully uninstalled 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Install failed. Rolling back...
    Could not install package 'Microsoft.AspNet.WebApi.Client 5.2.2'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10', 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.

    Are Windows Phone and Silverlight incompatible with PCL's using Web Api? 

    Monday, December 22, 2014 5:05 PM


  • Correct. The PCL can use only API which are available to all of its targets. ASP.Net is not available to Windows Phone apps.
    • Marked as answer by DaveIII Monday, December 22, 2014 6:53 PM
    Monday, December 22, 2014 6:31 PM