Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Xamarin.Forms targets have been imported multiple times

a few hours ago, my solution just builds success, but after that it has error "Xamarin.Forms targets have been imported multiple times." I have struggled with that a whole week. enter image description here

my project here:

file my project

I didn't see any multiple xamarin.forms at all.

like image 469
Harry Avatar asked Feb 14 '19 05:02

Harry


1 Answers

This can be because of the move to using PackageReference for your NuGet packages and a simple fix awaits you.

1.Close Visual Studio and navigate to the Solution in File Explorer Delete the hidden .vs folder .

2.Go into each affected project sub folder and delete the following files; project_name.nuget.props and project_name.nuget.targets .

3.Open the solution in Visual Studio, do a Clean and Rebuild.

like image 168
Lucas Zhang Avatar answered Dec 07 '22 00:12

Lucas Zhang