Personal Blog: Not representative of Microsoft.
By modifying the .CSProject Profile you will be able to have your .NET Standard Library work as intended with Xamarin!
Error:
Package Xamarin.Forms 2.3.4.267 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package Xamarin.Forms 2.3.4.267 supports:ย
Original Post:
Link
Came across the post after having issues with my project.json file not working anymore after the latest update.
Here is my Fix:
Then change the .csproj file to the following for netstandard1.4 as the example.
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard1.4</TargetFramework> <PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback> </PropertyGroup> Other stuff here </Project>
How it Works?
Basically we are telling the project that it can accept any of these “fallback” or second option targets, this enables a lot more compatibility with older NuGet Packages.
<PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback>
Clean Build -> Compile & It works ๐
How to Fresh .Net Standard Project in Xamarin:
- Create .Net Portable Xamarin Project
- Create a new Standard Library
- Edit the Standard Library .csproj file as shown above
- Copy the files from the Original Portable Library into the NEW .Net Standard Project
- Add the Required NUGET Packages
- Reference & Compile!
Here’s my test project if your interested in seeing it..
(50mb download, I just zipped up my entire project)
Test File
You must be logged in to post a comment.