Search Unity

ApiCompatibilityLevelTest

Discussion in 'Entity Component System' started by GambitMonkey, Jul 28, 2020.

  1. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    So is entitities really supposed to still run under .NET Standard 2.0 when everything else has moved to 4.0? I just keep commenting out the code in the file ApiCompatibilityLevelTest and everything continues to work. However this is pretty annoying. I am using com.unity.entities@0.11.1-preview.4 and the error still occurs when switching to .NET 4.0.

    Code (CSharp):
    1. #if !NET_STANDARD_2_0
    2. #warning Project is expected to have API Compatibility Level set to .NET Standard 2.0
    3. #endif
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    .NET Standard it's a specification, which includes .NET Framework it's not new\old version of the same thing, it's absolutely different things. Everything moved from old .NET Framework to new .NET Framework and .NET Standard it's the next step for some things (In context of Unity)
     
    Last edited: Jul 28, 2020
  3. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    In particular for .NET 3 and .NET 5 with which the old framework slowly but surely will be put to the rest it deserves.

    To visualize it, take a look at this venn diagram and consider it a sheft to the left.

    Edit. Unity will not move to .NET 3.1 but only to .NET 5 to only make the hard break once and not twice as noted here.
     
    Last edited: Jul 28, 2020
  4. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    But in the context of Unity they defaulted to the .NET 4.x compatibility, which most Assets including myself use. However enititities needs .NET Standard 2.0? Seems like a disconnect and doesn't make sense to me.
     

    Attached Files:

  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    You should not be using .net 4 anymore unless you have a legacy project, in which case you probably aren't using ecs anyway

    .Net standard 2.0 is somewhat equivalent to .net framework 4.6.1

    https://docs.microsoft.com/en-us/dotnet/standard/net-standard
     
  6. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Careful with this. To quote the footnote of the table you have linked. I mean, you are correct with the somewhat part, but I thought it might be good to raise awareness on that.
     
  7. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    True, the whole thing is a mess (hence I said somewhat). The only real reason to use framework is for library that doesn't exist in standard.

    Point still stands though.
     
    MNNoxMortem likes this.
  8. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    Thank you all for your input and insight. Reading this it seems that the .NET 4.x has more support though and even TLS 1.2 support requires the .NET 4.x setting. It does seem Unity recommends Standard 2.0 for a smaller footprint and to be more platform compatible. https://docs.unity3d.com/2020.2/Documentation/Manual/dotnetProfileSupport.html

    However the 4.x looks to have the advantage of being able to use more of the API and a greater pool of third party libraries. https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2019

    We use some of the major assets off of the store such as Vegetation Studio Pro and almost all of them require the .NET 4.x setting and almost all of them are targeting the new DOTS systems.

    Definitely something to look at and consider when creating a new project and the assets to be used.

    Again thanks for the feedback!
     
  9. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    This is not true. VS works fine as will most other assets.