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.
Refit supports .NETStandard 1.1 and higher. You need to switch to a different PCL type (Profile 111) or use NETStandard directly for your portable library.
PCL 259 is only compatible with NETStandard 1.0.
Like AliciaSAvril I Tried to add refit to a Solution with a PCL Project . Tried multiple Profiles: Profile 78, 7 and 111. All failed. (Took me a few hours to find out). Is there any way to add refit to a current Xamarin-installation? (also using MvvmCross)
Ok, had to use Version 2.4.1. Works with the Xamarin default Profile 72 too.
@ipalfy what errors were you getting? what version of VS or XS are you using? It should work with Profile 111.
I use Xamarin 6.1.2 (build 44). Looks like Package Manager gets into trouble when trying to add System.Runtime (.Interop) I think. However: refit 2.4.1 runs fine.
@mhutch are you aware of issues installing .NET Standard packages into profile based PCL's with XS 6.x?
Nope. /cc @mrward
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.
Does NETStandard.Library 1.6.1 fix this? I believe it references the 4.3.0 packages by default and would b reason enough for us to specify that as the min if it fixes stuff like this.
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.
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>
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ášeknotifications@github.com
Sent: Thursday, December 29, 2016 5:46 PM
To: paulcbetts/refitrefit@noreply.github.com
Cc: Oren Novotnyoren@novotny.org; Commentcomment@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 Studio2017CommunityMSBuild15.0BinMicrosoft.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
—
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.
Hm, I didn't. Is there any upstream bug to follow? Currently it's ok for me to use 2.x version.
Yes looks like you need NETStandard.Library 1.6.1 before you can install 3.0.0+ (profile 111)
You can always install NETStandard.Library 1.6.1 separately/first and then NuGet should do the right thing as a workaround until the dependency version is raised.
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'm having the same problem, and none of the above solutions works anymore, .... any more solution?
Will be fixed in 3.1
So, Is't enough to install refit via nuget and reference .netstandard lib into PLC project?
Most helpful comment
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:
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.