I want to use the some classes of the System.Numerics assembly in my own DLL project which is used in some other projects too. But I run into problems with Unity3D targeting UWP Hololens. In editor it works out of the box but when I build the project Unity complainserror CS7069: Reference to type 'Vector3' claims it is defined in 'System.Numerics', but it could not be found
I copied System.Numerics.Vector.DLL from Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api. 4.7.1 should be the one according to this Unity blog post. I tried out different versions (even 4.5) but it does not work either.
My own DLL uses 4.7.1 as well (tried 4.6.1 at the beginning). Now the editor complains that Loading script assembly "Assets/DLLs/System.Numerics.Vectors.dll" failed!. Thus I excluded the editor platform.
As next I tried using System.Numerics.dll (i.e. not just the Vectors). Now the results are even stranger:CS0433: The type 'Vector3' exists in both 'System.Numerics.Vectors ... System.Numerics.
My own DLL is completely in plain old C#, nothing special, no file access, ...
So how can I do this? Yes I know there is Vector3D class in Unity :) But I need to build a DLL that is used outside Unity.
Update:
I removed all direct calls to System.Numeric namespace classes. Now the UWP solution builds but with a bunch of post-processing errors:
Reference rewriter: Error: type 'System.Numerics.Vector3' doesn't exist in target framework. It is referenced from ARSceneSerialization.dll at ARSceneSerialization.ARKeyFrame.
I think this sounds bad.
C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dllreference to it but going to Project > Add Reference > Browse. Also, add theSystem.Numericsreference it inMonoBleedingEdge\lib\mono\4.5. Now, try to build it. If you still get errors, delete thoseSystem.NumericsandSystem.Numerics.Vectorsfrom your project and try again - Programmer