vs for Mac Xamarin.Forms error after converting PCL to Netstandard

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.