Severity Code Description Project File Line Suppression State Error Could not install package 'Refit 4.0.1'

david picture david · Sep 28, 2017 · Viewed 16.6k times · Source

Installing Refit in Xamarin MvvmCross Profile 111 .NetPortable 4.5

Severity    Code    Description Project File    Line    Suppression State Error Could not install package 'Refit 4.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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.    0

Issued in Refit Issue #376

The docs did say

Refit currently supports the following platforms and any .NET Standard 1.4 target:

  • UWP
  • Xamarin.Android
  • Xamarin.Mac
  • Xamarin.iOS
  • Desktop
  • .NET 4.5
  • .NET Core

Have I missed something?

Answer

Cheesebaron picture Cheesebaron · Sep 28, 2017

You are installing Refit 4 into a PCL. Refit is a NET Standard 1.4 library which cannot be consumed by any PCL profile.

Upgrade your PCL to NET Standard (minimum 1.4) or downgrade Refit to a previous version which was not NET Standard.