System.Numerics.Vectors is an ambiguous reference since 2021.2

I have code that has been using System.Numerics.Vectors.Vector3.

The issue is that starting in the 2021.2 lines there exist two references to System.Numerics.Vectors. Looking at the assembly references they come from:

/Unity/Hub/Editor/2021.2.0b9/Editor/Data/NetStandard/compat/2.1.0/shims/netstandard/System.Numerics.Vectors.dll
and
/Unity/Hub/Editor/2021.2.0b9/Editor/Data/NetStandard/Extensions/2.0.0/System.Numerics.Vectors.dll

Leading to an ambiguous reference exception that I can’t fix because its exactly the same namespace. I also can’t exclude any libraries or something similar because they are automatically referenced by Unity.

Switching back to 2021.1.19f1 resolves this issue.

It’s probably related to this issue: 2021.2.0b6 and System.Memory/ReadOnlySpan under .NET 4.8

Luckily, it’s being investigated.

Reported it as a bug anyway: https://fogbugz.unity3d.com/default.asp?1362491

It might be related but I think its a slightly different issue, as Unity seems to be shipping two dlls that provide the same classes in the default configuration even without any additional packages.

3 Likes