6
votes

I am attempting to convert my Xamarin project to use .net Standard 2.

  • I have added the .net standard 2 library
  • I have installed all the nuget packages that previously existed in my pcl library. (all build fine)
  • Then I removed the pcl and added the std library

However when I build I get a few compile time exceptions:

  • Could not load assembly 'IdentityModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
  • Could not load assembly 'XLabs.Forms, Version=2.0.5782.12218, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?

Those ddl indeed does not exist in the Android bin folder. If I copy the dlls in manually the build error goes away.

I am not that familiar with the new .net standard stuff to know if these libraries are maybe not being copied over because of incompatibilities.

How do I fix this?

EDIT: The nuget packages above is only added to the common std and pcl library not the Android 1. This worked with the pcl version so I assumed similar behavior with the std version. I had to install it into the android version to make it work. Why was necessary in the std and not the pcl?

1

1 Answers

1
votes

You need to add the following NuGet packages to your Xamarin.Android project:

I'm not sure why the PCL implementation worked without these packages in your Xamarin.Android project. Likely, the package creators are using Bait and Switch with the netstandard implementation.