vs for Mac Xamarin.Forms error after converting PCL to Netstandard
Error content:
Xamarin.Forms targets has been imported multiple times. Please check your project file and remove the duplicate import (s). (XF001)
Solution:
After Google, find a solution.
Original:
If you converted the PCL project to. NET standard via the project options the project would be using a project.json. NuGet would generate and also import the Xamarin.Forms.props and Xamarin.Forms.targets:projectname.nuget.props and Projectname.nuget.targets. If your project file that uses the Project.json file also imports the Xamarin.Forms.targets then that's May is the double IM Port.
I just reproduced that problem myself with VS Mac 7.3.3. I created a xamarin.forms Class Library (multiplatform-library) from the project template and then went into Project option s build-general and converted the PCL to. NET Standard. Then tried to build the project. I see a build error xamarin.forms.2.5.0.121934/build/portable-win+net45+wp80+win81+wpa81/ Xamarin.Forms.targets (3,3): Error XF001:Xamarin.Forms targets has been imported multiple times. Please check your project file and remove the duplicate import (s). (XF001)
. To fix this I edited the. csproj and removed the Xamarin.Forms.targets import from the file:
<Import Project="..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists(‘..\packages\Xamarin.Forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets‘)" />
The translation comes from the. csproj in <import Project=". \packages\xamarin.forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\xamarin.forms.targets " Condition="Exists ('. \packages\xamarin.forms.2.5.0.121934\build\portable-win+net45+wp80+win81+wpa81\xamarin.forms.targets ') " /> Deleted and reopened on the line.
vs for Mac Xamarin.Forms error after converting PCL to Netstandard