fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 524 forks source link

Adding references that already exist for Xamarin android projects #2798

Open btrepp opened 7 years ago

btrepp commented 7 years ago

Description

Paket adds transient references for xamarin that seem to be already added (possibly due to some xamarin project imports)

Not sure if this is actually pakets fault, but it does mean it doesn't work nice with xamarin. I haven't tested if nuget fails similarily.

Repro steps

  1. Create New solution
  2. Add xamarin csharp android project
  3. Add paket.references and paket.dependencies with "Hopac"
  4. paket install
  5. build in visual studio 2017

See. https://github.com/btrepp/xamarinpakethopac

Expected behavior

No build errors

Actual behavior

Severity    Code    Description Project File    Line    Suppression State
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Xml.XDocument\lib\netstandard1.3\System.Xml.XDocument.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Xml.XDocument.dll'. Remove one of the duplicate references. xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Threading.Tasks.Parallel\lib\netstandard1.3\System.Threading.Tasks.Parallel.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Threading.Tasks.Parallel.dll'. Remove one of the duplicate references.    xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Threading\lib\netstandard1.3\System.Threading.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Threading.dll'. Remove one of the duplicate references. xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Runtime.Numerics\lib\netstandard1.3\System.Runtime.Numerics.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Runtime.Numerics.dll'. Remove one of the duplicate references.    xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Reflection.Emit.Lightweight.dll'. Remove one of the duplicate references.   xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Reflection.Emit.ILGeneration.dll'. Remove one of the duplicate references.    xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Reflection.Emit.dll'. Remove one of the duplicate references.   xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.ObjectModel.dll'. Remove one of the duplicate references.   xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Linq.Queryable\lib\netstandard1.3\System.Linq.Queryable.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Linq.Queryable.dll'. Remove one of the duplicate references.  xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active
Error   CS1703  Multiple assemblies with equivalent identity have been imported: 'C:\Users\Beau\Code\xamarinpaket\packages\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Collections.Concurrent.dll'. Remove one of the duplicate references.  xamarinpaket    C:\Users\Beau\Code\xamarinpaket\xamarinpaket\CSC    1   Active

Known workarounds

Removing the references added seems to result in a successful build, though paket adds them back on 'paket install'

forki commented 7 years ago

/cc @nosami @7sharp9 any ideas? I don't know how to repro since I don't have xamarin and VS fails me

btrepp commented 7 years ago

I'm using xamarin in Visual Studio 2017 community, Its free and selectable in the visual studio installer.

7sharp9 commented 7 years ago

I can confirm it built fine for me from the repo above on a mac.

7sharp9 commented 7 years ago

I can confirm it built fine for me: https://gist.github.com/7sharp9/b2f1cc204d17838d96537e9fff8812fc

SpiegelSoft commented 7 years ago

I can confirm that this issue is here for Visual Studio 2017 on Windows 10.