XF库引用相互冲突

问题描述 投票:0回答:1

我已经将我的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)
xamarin.forms .net-standard-2.0
1个回答
0
投票

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

<PackageReference Include="RoyalXamarinComponents" Version="1.1.3" >
     <PrivateAssets>all</PrivateAssets>
</PackageReference>
© www.soinside.com 2019 - 2024. All rights reserved.