locked
Build has broken by adding a Nuget package which uses Microsoft.NETCore.Portable.Compatibility RRS feed

  • Question

  • User365885 posted

    Hi, I'm a new developer for Xamarin.Forms.

    Last night, I've created new Xamarin.Forms app with Android only. It was builded successfully on first time, but after I added 'Combinatorics' package, the build is broken.

    Belows are logged errors. CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll' and 'C:\Users\User\.nuget\packages\microsoft.netcore.portable.compatibility\1.0.1\ref\netstandard1.0\mscorlib.dll'. Remove one of the duplicate references.

    And related on this error, there are many errors like Resources/Resource.designer.cs(12,36): error CS0731: The type forwarder for type 'System.Attribute' in assembly 'System.Runtime' causes a cycle and Resources/Resource.designer.cs(409,17): error CS0518: Predefined type 'System.Int32' is not defined or imported

    'Combinatorics' package depends on 'Microsoft.NETCore.Portable.Compatibility' and I can't remove this dependency.

    Is there any solution for this? Attached file is repro of this issue and here is my environment.

    Microsoft Visual Studio Professional 2017 Version 15.5.7 VisualStudio.15.Release/15.5.7+27130.2036 Microsoft .NET Framework Version 4.7.02556

    Visual C# 2017 00370-20007-76118-AA391

    Merq 1.1.17-rc (cba4571)

    Mono Debugging for Visual Studio 4.8.4-pre (3fe64e3)

    NuGet Package Manager 4.5.0

    VisualStudio.Mac 1.0 Mac Extension for Visual Studio

    Xamarin 4.8.0.760 (fc93f3f5b) Xamarin.iOS ? Xamarin.Android ????????? Visual Studio ????

    Xamarin Designer 4.8.188 (c5813fa34) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Xamarin.Android SDK 8.1.5.0 (HEAD/75f8c6838) Xamarin.Android Reference Assemblies and MSBuild support.

    Xamarin.iOS and Xamarin.Mac SDK 11.6.1.4 (db807ec) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

    ?????? Windows ???? Visual Studio Tools 15.0.27130.2036 ?????? Windows ???? Visual Studio Tools ????????????????PC ???Windows 10 ???????????????????????? ????????????????????? Microsoft Windows 10 ????????????????????

    Please help!

    Wednesday, February 28, 2018 12:02 PM

Answers

  • User365885 posted

    I temporary resolved this isuue by following this(ttps://github.com/TorbenK/TK.CustomMap/issues/131#issuecomment-257271077). (can't post link yet ...) <dependencies> <group targetFramework=".NETStandard1.2"> <!--dependency id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" exclude="Build,Analyzers" /--> <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" /> </group> </dependencies> After doing this, the build success.

    But I'm still looking for the 'right' solution. Any information is appreciate.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, March 3, 2018 2:38 PM

All replies

  • User365885 posted

    I temporary resolved this isuue by following this(ttps://github.com/TorbenK/TK.CustomMap/issues/131#issuecomment-257271077). (can't post link yet ...) <dependencies> <group targetFramework=".NETStandard1.2"> <!--dependency id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" exclude="Build,Analyzers" /--> <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" /> </group> </dependencies> After doing this, the build success.

    But I'm still looking for the 'right' solution. Any information is appreciate.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, March 3, 2018 2:38 PM
  • User29117 posted

    @hyge, to clear things up, the changes were made to the NuGet package's .nuspec file, correct?

    @hyge said: I temporary resolved this isuue by following this (https://github.com/TorbenK/TK.CustomMap/issues/131#issuecomment-257271077). (can't post link yet ...) <dependencies> <group targetFramework=".NETStandard1.2"> <!--dependency id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" exclude="Build,Analyzers" /--> <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" /> </group> </dependencies> After doing this, the build success.

    But I'm still looking for the 'right' solution. Any information is appreciate.

    Tuesday, April 24, 2018 5:04 PM
  • User365885 posted

    @DamianSuess , Yes, I edited the .nuspec file at "{UserDir}\.nuget\packages\combinatorics\1.1.0.19\combinatorics.nuspec".

    Wednesday, April 25, 2018 2:37 PM