. NET Core - PCL Troubleshooting
.Net core tutorial
.NET Core - PCL Troubleshooting
In this chapter we will fix the error that we have installing the NuGet package from our private feed in the Xamarin.Forms project.
We will understand the problem in more detail in brief. To get started, right click on the PCL library and select Properties.
On this page you will see the whole set of targeted frameworks. From the error you can see that .NETPortable 259 profile is not compatible with our StringLibrary 1.0.1. However, it tries to take reference to the .NET Standard 1.1 library.
Now let's take a look at the .NET standard library and identify which platform is not compatible with our library.
You can see that Windows Phone Silverlight 8 is compatible with .NET Standard 1.0. If you open the following web page, you will see that Profile259 can only support .NET Standard 1.0.
Now let's deactivate Windows Phone Silverlight 8.
Click on the OK button.
Now to solveThis problem occurs, click OK and cancel the Edit Targets dialog box, then open the Package Manager console and run the following command.
PM> Uninstall-Package Xamarin.Forms
Now let's go to the properties of the PCL library. Click on the Modify button .
Uncheck Windows Phone Silverlight 8 and click OK.
You can now see that Windows Phone Silverlight 8 is no longer available in the targeted frame. You can also see the profile that is the target now. To see this, let's unload the PCL library and edit the XamarinApp.csproj file.
You can now see that TargetFrameworkProfile is now Profile111.
I If you open the documentation you will see that Profile111 supports .NET Standard 1.1.
Now let's reload the PCL again and open the NuGet package manager and try to install the StringLibrary package from a private stream.
From the Dependency behavior drop-down list, select IgAdd the dependencies, then click Install .
You can see that the StringLibrary package is now installed from the private stream. If you expand the references of PCL, you will see that the reference StringLibrary is also added as shown below.
We uninstalled Xamarin.Forms for the Windows Phone Silverlight 8 issue. Xamarin.Forms must be installed again. It is recommended to install the same version.
Once the installation is complete, let's use the StringLibrary functionality in your application.