Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question .NET profile support

Discussion in 'Editor & General Support' started by hugeandy, Nov 16, 2022.

  1. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    130
    Hi,

    On the .NET profile support documentation page (https://docs.unity3d.com/Manual/dotnetProfileSupport.html) it states "If you need broad cross-platform compatibility, then set the Api Compatibility Level to .NET Standard".... "Although some platforms don’t fully support the .NET Standard profile, the .NET Framework profile is less suitable for cross-platform compatibility."

    It'd be great to know:
    1. What does it mean by "broad cross-platform compatibility" - are we talking about compiler issues or runtime differences?
    2. Which platforms don't full support .NET Standard
    3. Why is .NET Framework less suitable for cross-platform compatibility

    We are working on PC, Xbox, PlayStation and Switch and (I'm being aware confidentiality agreements) it'd be good to know if the compatibility issues involve any of these platforms and what the issues are

    Cheers!
    Andy
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,756
    Probably a little of both.

    There's another axis too, Mono vs IL2CPP. For instance System.Process will throw NotImplementedExceptions in IL2CPP.

    Don't worry, you'll soon know. :)

    Not trying to be flippant about it but if your engineers are writing nice simple code you probably won't have any issues. On the other hand if your engineers are reaching for every possible new bell and whistle and gee-gaw that just came out last week to the C# language (aka, Resume-Driven Development), then you're far more likely to run into issues.

    This also applies to third party libraries, obviously.

    At the end of the day, you're gonna have to test and work around issues.

    This is why everywhere you read will tell you, Test early, test often, test on the actual target hardware.

    It very well may be that you need conditional compiles, or that not all of your game's features will be truly fully supportable (or supportable identically) on all platforms.
     
  3. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    130
    So the conclusion is that we'd know if we had problems? Our game is live on PC & XBox at the moment.

    And it's more to do with something either will or won't work, not that it'd work in two different ways on different platforms?

    It'd be nice to have some definites, does anyone actually know what compatibility issues mean or is it just a "some things are different but we don't know what"

    I am an engineer and we're not using modern language features like that, but we do have a cross platform multiplayer game so when I see something which influences "cross platform compatibility" my ears prick up and I want to find definite answers, so that I can be sure our game is running as well as it can across platforms.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,756
    Even if I told you 100% of every microscopic detail of what is and isn't supported, you STILL have to test your game.

    Also, if I told you it supports X and then for some reason you find out it does NOT in your, has either of us improved the world by our actions?

    Then you should be fine. But as an engineer it is incumbent upon you to test your engineered solution.

    I suggest you review the broad documents that Unity publishes (or just google up other people's postings) and then make your game and do what you are going to do anyway: just test your game on the hardware targets you want.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    What that means is that not the whole API surface area of .NET Standard is supported on all platforms. For instance, you cannot use threads on WebGL or start new processes on platforms that use IL2CPP. Now, even more stuff is unsupported in the .NET Framework, that's why we're saying that using .NET Standard will ensure best compatibility.
     
  6. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    130