Skip to content

Found conflicts between different versions of "System.Numerics.Vectors" that could not be resolved #6375

Description

@MagicAndre1981

Steps to Reproduce

  1. create a new Xamarin.Forms application
  2. install a nuget that depends on System.Numerics.Vectors 4.5.0 like System.Text.Json or Signalr
  3. build the app

Expected Behavior

no warnings in output

Actual Behavior

warnings about version conflict:

Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "System.Numerics.Vectors" that could not be resolved.
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: There was a conflict between "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll].
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll".
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             System.Numerics.Vectors
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         C:\Users\USERNAME\.nuget\packages\system.text.json\5.0.2\lib\netstandard2.0\System.Text.Json.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\USERNAME\.nuget\packages\system.text.json\5.0.2\lib\netstandard2.0\System.Text.Json.dll".
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\system.text.json\5.0.2\lib\netstandard2.0\System.Text.Json.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.http.connections.common\3.1.19\lib\netstandard2.0\Microsoft.AspNetCore.Http.Connections.Common.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             D:\Foo.App\Foo.App\Foo.App\bin\Debug\Foo.App.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.http.connections.client\3.1.19\lib\netstandard2.1\Microsoft.AspNetCore.Http.Connections.Client.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.signalr.client\3.1.19\lib\netstandard2.0\Microsoft.AspNetCore.SignalR.Client.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.signalr.common\3.1.19\lib\netstandard2.0\Microsoft.AspNetCore.SignalR.Common.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.signalr.client.core\3.1.19\lib\netstandard2.1\Microsoft.AspNetCore.SignalR.Client.Core.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.signalr.protocols.json\3.1.19\lib\netstandard2.0\Microsoft.AspNetCore.SignalR.Protocols.Json.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.aspnetcore.signalr.protocols.newtonsoftjson\3.1.19\lib\netstandard2.0\Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson.dll
Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             C:\Users\USERNAME\.nuget\packages\microsoft.extensions.logging.eventsource\3.1.19\lib\netstandard2.0\Microsoft.Extensions.Logging.EventSource.dll

Version Information

Version 16.11.4
VisualStudio.16.Release/16.11.4+31727.386
Microsoft .NET Framework
Version 4.8.03752

Xamarin 16.11.000.190 (d16-11@2391ed9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.11.0.17 (remotes/origin/11e0001f0b17269345e80b58fb3adf1ba4efe2cd@11e0001f0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.10.5 (355b57a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.4.0.5 (d16-11/7776c9f)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c633fe9
Java.Interop: xamarin/java.interop/d16-11@48766c0
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@683f375

Now there is the question if we can ignore this, may this cause runtime errors?

Activity

  1. jonathanpeppers commented on Oct 11, 2021

    @jonathanpeppers
    Member

    @MagicAndre1981 can you share the exact <PackageReference/> you have in a .csproj that hits these warnings? Thanks.

  2. MagicAndre1981 commented on Oct 12, 2021

    @MagicAndre1981
    Author

    @MagicAndre1981 can you share the exact <PackageReference/> you have in a .csproj that hits these warnings?

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.SignalR.Client">
          <Version>3.1.20</Version>
        </PackageReference>
        <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json">
          <Version>3.1.20</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
        <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
      </ItemGroup>
    

    Repro steps are easy, create new XF app and add those 2 SignalR packages

  3. MagicAndre1981 commented on Jan 24, 2022

    @MagicAndre1981
    Author

    Still happens in VS 2022 17.1 Preview 3 with SignalR 6.0.1 references. Addding System.Numerics.Vectors directly via PackageReference Include makes no difference.

    I checked a new MAUI App in 17.1 Preview 3 and here the System.Numerics.Vectors 6.0.1 is used and I see no warning. So this is an "issue" with old xamarin.

  4. jonathanpeppers commented on Jan 24, 2022

    @jonathanpeppers
    Member

    @MagicAndre1981 I'm afraid this issue probably won't be able to be solved until .NET 6. Do you have the problem in a dotnet new android or dotnet new maui app?

  5. MagicAndre1981 commented on Jan 25, 2022

    @MagicAndre1981
    Author

    with .net 6 it works fine. So this only happens in old classic xamarin.

  6. jpobst commented on May 2, 2024

    @jpobst
    Contributor

    With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.

    If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android or greater. Please include a link to this issue for context.

  7. locked and limited conversation to collaborators on Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions