Search Unity

Unity.Mathematics not compatible with the currently available .NET

Discussion in 'Package Manager' started by ATYL, Oct 16, 2018.

  1. ATYL

    ATYL

    Joined:
    Oct 1, 2018
    Posts:
    8
    I'm trying to build a standalone scene in Unity 2018.2.12f1

    Almost every .cs file in the Unity.Mathematics package is throwing the error CS0117: 'MethodImplOptions' does not contain a definition for 'AggressiveInlining'

    After some research, this is because .Net 4.0 does not have AggressiveInlining
    upload_2018-10-16_15-37-54.png
    upload_2018-10-16_15-38-35.png

    But unity cannot go any higher

    upload_2018-10-16_15-40-59.png

    What should I do?
     
  2. pedro_unity

    pedro_unity

    Joined:
    Jan 16, 2017
    Posts:
    172
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @ATYL:

    I'm curious to know where you see this compilation error. Does it occur in the Unity editor and in Visual Studio? Or is it just in one or the other?
     
  4. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Could you try to install a recent version of .NET? (from https://www.microsoft.com/net/download/dotnet-framework-runtime )

    It looks like you have only 4.0 installed while 4.5+ is at least required for using MethodImplOptions.AggressiveInlining.

    By curiosity, which version do you have installed in the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Cross reference this thread, seems like this is a problem in the beta as well?
     
  6. ATYL

    ATYL

    Joined:
    Oct 1, 2018
    Posts:
    8
    I've had .Net 4.5 and 4.71 installed, but have not been able to get unity to select these.

    There was a workaround though, if anyone else has this issue.

    Go into '\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.mathematics@0.0.12-preview.19\Unity.Mathematics'

    and change every reference of MethodImplOptions.AggressiveInlining to just the number 256
     
  7. GabrielRos

    GabrielRos

    Joined:
    Oct 6, 2019
    Posts:
    2
    I'm getting the same issue when using Unity Cloud Build with Unity version 2019.4.8f1. I have tried multiple versions of the Mathematics package but none work so far. Tried with both .Net 4.x and .Net Standard 2.0, any suggestions on what else to try? I can't make changes in \AppData\ since I don't manage the infrastructure.