0
votes

I have an Xamarin.Forms project in which I want to use ZXing library for barcode scanning. However I am unable to install package ZXing.Net.Mobile and ZXing.Net.Mobile.Forms into my portable project. The exception I keep getting is as follows:

Could not install package 'ZXing.Net.Mobile 2.0.4.46'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Any ideas on how to solve this?

2
Which targets does your PCL include? @DenisVitezAkash Amin

2 Answers

2
votes

I took a quick look at the package contents, and the package is not completely targeting PCL Profile 111 (.NET Framework 4.5, Windows 8, Windows Phone 8.1) according to the folder name. The portable library is located in the folder:

lib/portable-net45+netcore45+wp8+UAP10.0+MonoAndroid403+MonoTouch10+Xamarin.iOS10

which is missing out wpa81 (i.e. Windows Phone 8.1 non-Silverlight) to be compatible with PCL Profile 111.

Since netcore45 and UAP10.0 are included in the folder name, I suspect that the missing wpa81 specification is just an oversight by the package authors and could be added to the folder name without problems. Of course, this has to be confirmed with the package authors, and they would need to update the NuGet package.

As a side note, I also believe the folder name is a little bit "overdone". For maximum compatibility, I think it would be better to exclude the UAP and Xamarin specifications. NuGet targets these platforms automatically if standard lib folder naming conventions are used.

0
votes

If you don't need Windows Phone 8.1, as per Denis Vitez comment above, changing to Profile 7 allows you to install ZXing.Net.Mobile and ZXing.Net.Mobile.Forms.