Xamarin Forms - Orientation .NET Standard

I read this article a while ago: https://blog.xamarin.com/net-standard-library-support-for-xamarin/

So, I converted all of our libraries from portable libraries to .NET Standard (1.4). I did this because the article says: "Now this PCL needs to be updated to configure the standard .NET library that can be found in the project properties."

However, I cannot figure out how to create a Xamarin Forms project that is for .NET Standard. I cloned Xamarin Forms samples and opened the MasterDetailPage project. I went into the project properties and switched from portable to .NET Standard according to the instructions. Immediately, I get a message saying that I need to choose NuGet 3.0 support. I'm fine with this, but how do I do this?

I found that if I uninstall the Xamarin Forms NuGet package, I can upgrade to .NET Standard. However, once I have done this, I cannot add the Xamarin Forms NuGet package back. He just fails. Unlike the article, I cannot add links to the .NET Standard libraries. When I try to add a link to existing .NET Standard libraries in my solution, Visual Studio just gives me an error saying that the library is incompatible. What version of .NET Standard should I plan for Xamarin forms?

How to get the .NET Standard library with support for Xamarin Forms?

+4
source share
2 answers

, .NET Standard Xamarin Forms NuGet , , .NET Standard Xamarin Forms.

, . , project.json. https://xamarinhelp.com/dot-net-standard-pcl-xamarin-forms/

, Git, . https://github.com/adamped/XamarinForms.NetStandard.git

.NET Standard 1.4 .

+4

Visual Studio 2017 csproj project.json, dotnet migrate CLI / csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback>
  </PropertyGroup>

</Project>
+5

Source: https://habr.com/ru/post/1666324/


All Articles