zoukankan      html  css  js  c++  java
  • vs for mac xamarin.forms 将pcl转换为netstandard后报错

    vs for mac xamarin.forms 将pcl转换为netstandard后报错

    报错内容:

    Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s). (XF001)

     

    解决方案:

    经过一番谷歌后,找到解决办法。

    原文:

    If you converted the PCL project to .NET Standard via the project options the project will be using a project.json. NuGet will generate two files that 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 may be the double import.

    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, then went into project options 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 have 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="..packagesXamarin.Forms.2.5.0.121934uildportable-win+net45+wp80+win81+wpa81Xamarin.Forms.targets" Condition="Exists('..packagesXamarin.Forms.2.5.0.121934uildportable-win+net45+wp80+win81+wpa81Xamarin.Forms.targets')" />

    翻译过来就是把 .csproj  中的<Import Project="..packagesXamarin.Forms.2.5.0.121934uildportable-win+net45+wp80+win81+wpa81Xamarin.Forms.targets" Condition="Exists('..packagesXamarin.Forms.2.5.0.121934uildportable-win+net45+wp80+win81+wpa81Xamarin.Forms.targets')" />删掉后重新打开就行了。

     
     
  • 相关阅读:
    Matlab怎么修改显示数值格式/精度/小数位数
    java matlab 混合编程 Failed to find the required library mclmcrrt9_2.dll on java.library.path.
    Java学习路线图
    解决Java getResource 路径中含有中文的情况
    深入jar包:从jar包中读取资源文件getResourceAsStream
    Matlab调用Java类
    java调用matlab绘图
    轮盘赌算法
    matlab中cumsum函数
    matlab运行出现“变量似乎会随着迭代次数改变而变化,请预分配内存,以提高运行速度”问题
  • 原文地址:https://www.cnblogs.com/xiaoa/p/8352854.html
Copyright © 2011-2022 走看看