2
votes

I am trying to implement finger touch login in my xamarin app

for that I have installed package Plugin. Fingerprint version 1.4.5.0

but it gives me an error while building

The primary reference "Plugin.Fingerprint, Version=1.4.5.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile111".

after searching for that error I got this solution

I've converted all projects in my Xamarin solution to netstandard1.1 (I used your guide) and now all works

but I m wondering it will not affect other feature of application? means this is the right solution? to degrade version like this will not affect any other things?

if yes what is the other solution to this error?

please help

4
Often higher versions keep compatibility with olders, especially when the minor version is what is changed. It generally include new features and bugs corrections.Diego Rafael Souza
@DiegoRafaelSouza sorry i didnt get you.i should go with solution or not?Neelam Prajapati
can you elaborate please.what exactly this .net standard version affects on pcl or any other project .and how it affects new package added for plugin.Neelam Prajapati
The .net standard is the library package over which the xamarin framework runs (prior to .net core). Aparently the Fingerprint plugin 1.4.5 was built over the .net standard package, and this affects the range of Profiles that the plugin may be compatible (more information here and here). In short, if the change doesn't affect your target, yes, you can use it.Diego Rafael Souza
ok.thank you for your help and time @DiegoRafaelSouzaNeelam Prajapati

4 Answers

3
votes

My problem was that I accidentally installed VS 2019 on Mac. I only wanted to update VS 2017, but you have to read the changes very carefully (no hint at front that you are upgrading VS!). Then I found a way to downgrade VS on Mac to VisualStudioForMac-7.8.4.1. Afterwards, I figured out that my Jenkins build (using msbuild) doesn't work with the above failure.

warning MSB3274: The primary reference "Plugin.Fingerprint, Version=1.4.6.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile7".

The msbuild version changed from 16.0.42-preview+g804bde742b to 16.0.459+g5b35a69a2e. Switching to xbuild showed me a deprecated warning as well as the Java version is not found (for Droid).

Luckily I found this post, where the solution is described.

TLDR:

1
votes

You have to update your Visual Studio I think it will solve the problem.

1
votes

I fixed this issue using these steps:

  • Right click to project and select unload project(In this case you should unload that you want to implement).
  • After that right click again and select edit.PROJECTNAME.csproj and update TargetFrameworkVersion to 4.5 enter image description here

  • Right click and reload project

That was my solution. I hope it helps.

0
votes

I ran into this issue and Visual Studio Mac had the hint path wrong. Newer versions of VS Mac don't appear to allow you to change the Mono version, so the advice above didn't work for me.

Here's what I had to change:

  1. Right click the project and select "Edit Project File"

  2. Look for the library that's causing you issues. For example:

    < Reference Include="Polly, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL"> ....\packages\Polly.5.1.0\lib\ netstandard1.0 \ Polly.dll < /HintPath>

(sorry for the weird markup... the editor is NOT liking the XML for some reason)

Note that it's targeting netstandard1.0? Well, if it's PCL 4.5, you need to change that to the following:

<Reference Include="Polly, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Polly.5.1.0\lib\net45\Polly.dll</HintPath>
</Reference>

If you look in your packages folder, you should see the net45 folder next to the netstandard1.0 folder. As long as your packages.config pointed to the right target framework, the package should have been restored properly. However, somehow VS Mac is using the wrong hint path. I don't know if this is a bug, but I've reported it nonetheless :)