The type or namespace name 'Vector<double>' does not exist in the namespace 'System.Numerics'

1.1k Views Asked by At

I tried to use System.Numerics.Vector<double>() in my code but got a build error

The type or namespace name 'Vector' does not exist in the namespace 'System.Numerics'

Am I missing an assembly reference?

My csproj targets .NET 4.6.1

<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>

<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />

enter image description here

Other types appear correctly

enter image description here

1

There are 1 best solutions below

1
On

When you look at the ToString method, for instance, the MSDN shows the .NET version in the top. But for Vector, strangely, it does not. It might have been moved from the .NET framework to the Nuget repository and MS kept the MSDN document without saying anything about it.

Anyway, if you make sure you are using the 4.6.1 runtime (it does not work on 4.5.1 and 4.5.2), just install this nuget package, it works fine.

image