【问题标题】:XF Library references conflict with each otherXF 库引用相互冲突
【发布时间】:2020-05-18 15:28:42
【问题描述】:

我已将我的一个 XamarinForms 类库项目升级到 .NetStandard2.0,现在当我将 nuget 包添加到我的另一个 .NetStandard2.0 项目时,它确实如此不要让我编译它并向我显示一些像这样的 8000 个错误:

/Volumes/Data/Projects/Project1App copy/Project1/Project1.Android/CSC: Error CS1703: Multiple assemblies with equivalent identity have been imported: '/Users/drtj/.nuget/packages/royalxamarincomponents/1.1.3/lib/netstandard2.0/System.Xml.XmlSerializer.dll' and '/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Xml.XmlSerializer.dll'. Remove one of the duplicate references. (CS1703) (Project1.Android)

或者这个

/Volumes/Data/Projects/Project1App copy/Project1/Project1.Android/CSC: Error CS1703: Multiple assemblies with equivalent identity have been imported: '/Users/drtj/.nuget/packages/royalxamarincomponents/1.1.3/lib/netstandard2.0/System.Threading.dll' and '/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Threading.dll'. Remove one of the duplicate references. (CS1703) (Project1.Android)

【问题讨论】:

  • 您的项目需要royalxamarincomponents 库吗?如果没有,删除它应该可以解决冲突
  • 这是我要添加的库

标签: xamarin.forms .net-standard-2.0


【解决方案1】:

尝试打开项目的.csproj 文件并将以下代码添加到<ItemGroup>

<PackageReference Include="RoyalXamarinComponents" Version="1.1.3" >
     <PrivateAssets>all</PrivateAssets>
</PackageReference>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-29
    • 2020-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-29
    相关资源
    最近更新 更多