Upgrading Xamarin Forms to .Net Standard 2
Asked Answered
F

1

6

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?

Flori answered 29/10, 2017 at 14:51 Comment(0)
B
1

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.

Bertrando answered 29/10, 2017 at 18:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.