Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Why not netstandard?

Discussion in 'Experimental Scripting Previews' started by leftler, Feb 28, 2017.

  1. leftler

    leftler

    Joined:
    Feb 4, 2016
    Posts:
    9
    From what I have read the new experimental release is targeting the .Net 4.6 framework. Why is unity not targeting the cross platform netstandard1.3 (which is equivalent in version to .NET 4.6) instead?

    I thought the entire reason of netstandard was to support easier cross platform compatibility which I would think Unity would be all over. Even the netstandard FAQ says you will be doing it but doing a search of this subforum returned no results for any posts mentioning netstandard at all.

    EDIT: Or are you actually targeting NetStandard2.0 (the version that comes with the vNext version of Mono) but you have just been calling it ".net 4.6 profile" to keep people from being confused.
     
    MiloDCooper, rakkarage and Qbit86 like this.
  2. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    We will be supporting netstandard 2.0 once it is finalized.

    Additionally, netstandard is a contract surface which can have multiple supporting implementations. We will support that surface across multiple class library implementations; likely a .NET 4.6 profile and a small AOT friendlier profile.
     
    MiloDCooper, Thaina, wesamco and 10 others like this.
  3. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    How many months away is this?
     
    Genom, dadude123 and Qbit86 like this.
  4. wesamco

    wesamco

    Joined:
    Jun 9, 2017
    Posts:
    1
    @joncham Now that .NET Standard 2 Preview 1 is out, since 3 weeks ago, and the final release is in 3 months.
    how are the plans looking for Unity?
    Unity3D scripting with the massive .NET Standard 2 APIs surface and C#7? support would be awesome. will the first release include support for IL2CPP and Emscripten/WASM compiler?

    thanks
     
    Thaina and Qbit86 like this.
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    We're working no on building a profile based on .NET Standard 2, but it is not ready yet. Please note that the .NET Standard 2.0 API is smaller than the full .NET 4.6 API though. You can use the full .NET 4.6 API for most platforms (including IL2CPP) in the 2017.1 beta releases now (we'd love to hear any feedback, as this is a experimental preview).

    Internally, we're now upgrading to the Mono 5.0 release, which includes the Roslyn C# compiler. We're not yet supporting Roslyn or C# 7 in Unity, as we have a good bit of tooling around the C# compiler to update as well. But we're on the path to providing that.

    Although, 2017.1 has experimental support for WASM builds via the WebGL platform. That is orthogonal to the new Mono runtime and C# support though.

    As usual we can't give any dates or timelines until things are ready, but we are working on all of this.
     
    Last edited: Jun 12, 2017
    mediumTaj and Qbit86 like this.
  6. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Really happy to hear that.

    Are you internally talking about the "c# project concept" so we use nuget packages? I know that we can drag *.dll inside assets manually but it's a workaround.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,935
    No, unfortunately we're not talking about a C# project concept. I don't expect that to change, at least initially, when support for a profile based on .NET Standard 2.0 is released.

    There is a team at Unity working on a package management concept, but I'm not familiar with the current status of their work.
     
    Daniel-Potter likes this.
  8. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    Ok thanks. I want to hear about that package management.
     
  9. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    @JoshPeterson thanks for the update. Hoping it arrives in less than 3 years!
     
    MiloDCooper and Qbit86 like this.
  10. j-borden

    j-borden

    Joined:
    Mar 3, 2015
    Posts:
    21
    Package management would be amazing! There are two things right now that make working with Unity as a library developer painful (well in particular developing a .NET Standard library):

    1) Unable to use .NET Standard libraries without a bunch of fuss
    2) Cannot simply pull in packages from an external feed (and have the dependencies come down). Although I can understand the hardships of this (There is no "profile" for Unity3D so which packages should be pulled? I don't think it is a guarantee or even an expectation at all that Xamarin iOS targeted libraries will work on Unity3D iOS for example)Al

    On the other hand, though, the recent upgrade has made things a lot easier than before to actually work so I also need to hand out the good with the bad: .NET 4.6 is awesome and feels like scratching a long overdue itch to me. I'm not sure how important this is to the "average" Unity3D user (not even sure what average would be in this case) but for me the situation until now was completely mind blowing (understandable and unfortunate given the licensing circumstances but still mind blowing and the cause of many rants to my superiors and coworkers....even the ones who know nothing about .NET LOL). I'm exceedingly happy to see that it has made this much progress and I hope that .NET Standard 2.0 is not far off.
     
    Qbit86 likes this.
  11. a-shoulson

    a-shoulson

    Joined:
    Jun 24, 2015
    Posts:
    8
    @j-borden Have you been able to get a netstandard library (1.3?) working and building in Unity? I've been trying and have it working in editor but I can't do it in a way that will produce a build. Is there some trick that gets it to work? Apparently netstandard 2.0 DLL support might make it into Unity 2017 sometime soon, but it would be nice to get a head start.
     
  12. j-borden

    j-borden

    Joined:
    Mar 3, 2015
    Posts:
    21
    I don't actually build that part inside of Unity. My main work is outside of Unity and so the assembly is already built at that point and I drop it into the Plugins folder so that the Unity project picks it up as a reference. I don't believe it is possible to build a .NET Standard library inside of Unity because Unity is unaware of that option. It only knows ".NET 4.6" I posted a blog post about how I put the DLL into the project if you are interested where I go into what I did and what went wrong.

    **EDIT** I realized my answer was to recompile with net46, but since net46 supports .NET Standard 1.3 you might have more luck than me with the first steps.
     
    Qbit86 likes this.