Hi everyone,
On a new project I have a build error when I try to add RestSharp on my iOS project. It's a Xamarin.Forms solutions using .NET Standard 2.0. I made a project using RestSharp and I need to add this nuget to my iOS project.
When I try to compile I have this error:
/Users/.../MyProject.iOS/CSC: Error CS1703: Multiple assemblies with equivalent identity have been imported: '/Users/.../.nuget/packages/system.reflection.emit/4.3.0/ref/netstandard1.1/System.Reflection.Emit.dll' and '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Reflection.Emit.dll'. Remove one of the duplicate references. (CS1703)
And many errors because of missing this reference.
My iOS csproj looks like:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ... Many build configuration ... <ItemGroup> <Compile Include="Main.cs" /> <Compile Include="AppDelegate.cs" /> <None Include="Entitlements.plist" /> <None Include="Info.plist" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="Xamarin.iOS" /> </ItemGroup> <ItemGroup> <PackageReference Include="Xamarin.Forms"> <Version>3.1.0.697729</Version> </PackageReference> <PackageReference Include="RestSharp"> <ExcludeAssets>all</ExcludeAssets> <Version>106.3.1</Version> </PackageReference> </ItemGroup> <ItemGroup> <ProjectReference Include="... Reference to my Forms project ..."> <Project>{19803808-B8EA-49D9-845B-ECF7CAFAC5D8}</Project> <Name>Live</Name> </ProjectReference> </ItemGroup> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> </Project>
Does anyone has an idea ?
Florian.