Could not load file or assembly System.Numeric.Vectors in ML.NET
Asked Answered
P

4

15

I created a new console application .net46, install the latest ML and tried a simple LDA. Got the error above. None of the fix that I found on the web seems to work. It is looking for a 4.1.3.0 version of the System.Numerics.Vectors that does not exist.

Prototrophic answered 20/4, 2020 at 13:45 Comment(1)
Have you tried adding the "System.Numerics.Vectors" NuGet package?Grayback
I
21

There is a problem that MSBuild requires version 4.1.3.0 but downloads 4.1.4.0 . You should add

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.4.0" />
    </dependentAssembly>
</assemblyBinding>

to MSBuild.exe.config . It usually located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin

I found this bug at Visual Studio 16.8.2 and 16.8.3 .

Immortal answered 10/12, 2020 at 8:28 Comment(6)
Still exists in 16.8.4, Thanks for sharingExurbanite
Still exists in 16.9.0Gentry
Still exist in Microsoft Visual Studio Community 2019 Version 16.9.2 (March 20th, 2021)Aman
E:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\BinAman
In case you have an indirect dependency to System.Numerics.Vectors, you may have to add the above <assemblyBinding> to App.config of your executable project.Coffeng
(Sigh.) I'm seeing this today with VS2022 v17.7.4 (Nov 2023). My solution had always worked until today, my "MSBuild.exe.config" hasn't changed in the past 4 months, and had <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />. Even changing that to 4.1.3.0 didn't help. Aaagghhhh!!!!Lesser
E
1

I think this may be related to this GitHub issue: https://github.com/dotnet/runtime/issues/26370

I think either trying to install the System.Numerics.Vector package as Jon suggested, or maybe update to net472 or .NET Standard 2.0 may help.

Eastwood answered 14/5, 2020 at 1:47 Comment(0)
S
1

Updating the Nuget package from version 4.4 to 4.5 resolved this for me while using a console app built targeting .NET Framework 4.8.

It does appear to be specific to the 4.3/4.4 version of System.Numerics.Vectors as the issue linked by Alex S says.

Suiting answered 9/2 at 13:39 Comment(0)
M
0

I got the error in VS 2019 Community Version 16.11.27

could not load file or assembly 'system.numerics.vectors, version=4.1.4.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or one of its dependencies. the located assembly's manifest definition does not match the assembly reference. (exception from hresult: 0x80131040)

The projects used to load fine before. Not sure how the issue suddenly came.

Uninstalling and re-installing the same Visual studio version worked for me

Malcah answered 6/7, 2023 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.