refit: Can't install refit 3.0.1 to Xamarin.Forms PCL; target compatibility error

Getting this error when trying to install refit v3.0.1 via NuGet to a Xamarin Forms project in Visual Studio. Fresh project, other NuGet packages include Microsoft.Azure.Mobile.Client, Microsoft.Bcl, Microsoft.Bcl.Build, Microsoft.Net.Http, Newtonsoft.Json, and Xamarin.Forms.

Could not install package 'refit 3.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

I’m having the same problem, and none of the above solutions works anymore, … any more solution?

refit fails to install into a PCL profile 111 project, which uses a packages.config file, in Xamarin Studio 6.1.2 (NuGet 3.4.3) and Xamarin Studio 6.2 (NuGet 3.5). The error reported is:

Could not install package 'System.Runtime.InteropServices.RuntimeInformation 4.0.0'. 
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.

I get the same error in Visual Studio 2015 (NuGet 3.5) with Dependency Behaviour set to Lowest.

A workaround for Xamarin Studio is to install System.Runtime.InteropServices.RuntimeInformation first, which will install a later version 4.3.0. In Visual Studio 2015 you can switch the dependency behaviour option to Highest and refit can be installed.

System.Runtime.InteropServices.RuntimeInformation 4.0.0 has a runtime/netstandard1.1 folder but it does not have a lib/netstandard1.1 folder which I am guessing is causing NuGet to fail.

So, Is’t enough to install refit via nuget and reference .netstandard lib into PLC project?

I think this is a bug oh the vs 2017 targets. Have you tried it in vs 2015 with all updates?

The latest VS 2017 RC has fixed this (edit: my issue https://github.com/paulcbetts/refit/issues/282#issuecomment-269705546)! 🎉

I think this is a bug oh the vs 2017 targets. Have you tried it in vs 2015 with all updates?

Sent from my Windows 10 phone

From: Jan Škrášekmailto:notifications@github.com Sent: Thursday, December 29, 2016 5:46 PM To: paulcbetts/refitmailto:refit@noreply.github.com Cc: Oren Novotnymailto:oren@novotny.org; Commentmailto:comment@noreply.github.com Subject: Re: [paulcbetts/refit] Can’t install refit 3.0.1 to Xamarin.Forms PCL; target compatibility error (#282)

I’ve got it installed, but I’m getting

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1909,5): warning MSB3274: The primary reference “Refit, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL” could not be resolved because it was built against the “.NETPortable,Version=v5.0” framework. This is a higher version than the currently targeted framework “.NETPortable,Version=v4.5,Profile=Profile111”.

My setup

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile>

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/paulcbetts/refit/issues/282#issuecomment-269705546, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABXHVBliXzqDNgOpGUKNDkmpf_kLjvpwks5rNDhSgaJpZM4LK1ZP.

Yes, NETStandard.Library 1.6.1 installs without any errors into a PCL project profile 111 with Xamarin Studio 6.1 and 6.2. It references System.Runtime.InteropServices.RuntimeInformation 4.3.0 as you expected.