Search Unity

System.Numerics missing in 2017.1f3

Discussion in 'Editor & General Support' started by Aurigan, Jul 11, 2017.

  1. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    I've switched the Scripting Runtime Version in Player Settings to .NET 4.6 but still getting editor compilation errors:

    error CS0234: The type or namespace name `Numerics' does not exist in the namespace `System'. Are you missing `System.Numerics' assembly reference?

    Are there other steps needed to enable .NET 4.6?
     
  2. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    Edit - reported as a bug and reproduced in a few minutes by Unity (#930754) ... I do wonder what the point of a 'support' forum is if Unity staff just ignores it though ...

    Ok, heard back from Unity (thanks Jonathan), apparent Unity doesn't actually link all of .NET by default so, fix is:

    * create a file called mcs.rsp in /Assets
    * contents should be -r:System.Numerics
    * reload script with issues

    This does work in the Editor but doesn't work in VS Code or Monodevelop on OSX or Visual Studio on Windows so ... still non functional for practical dev.

    edit - got it to work in VS by manually adding the reference to System.Numerics (In solution Explorer open up the project then right click on 'add reference') ... but this vanishes on restarting VS.
     
    Last edited: Jul 16, 2017
    depperm likes this.
  3. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    Still struggling to get this working fully and now getting no replies from Unity QA.

    Manually adding the reference in VS works until you try to build / attach to Unity at which point it looks like it triggers a sync from Unity which removes the reference.

    edit - tried Unity Answers (http://answers.unity3d.com/questions/1380461/unable-to-use-systemnumerics-in-unity-2017.html) and got the real solution there. No mcs.rsp needed, just have to copy the System.Numerics.dll *from the Unity install location* into my project and all is well.
     
    Last edited: Jul 18, 2017