Why is NET_STANDARD_2_0 expected with Entities 0.3.0-preview?

Out of curiosity:

#if !NET_STANDARD_2_0
#warning Project is expected to have API Compatibility Level set to .NET Standard 2.0
#endif
1 Like

Overall .NET is moving away from the .NET framework of old. .NET Core 3 is the latest version in the Core series and going forward the next version will be .NET 5. Unity transitioning to .NET Standard 2 compatibility is likely just them moving towards being closer to ready for .NET 5, because .NET Standard is currently the only standard framework that bridges the gap between .NET of old and .NET Core.

See the link below for extra information on the future of .NET.

4 Likes

Is there any official information about this? Do we really need to switch compatibility level back to .NET Standard 2.0 to be able to use DOTS properly? Or is it safe to ignore?

1 Like

.NET Standard 2.0 is more or less equivalent to .NET 4.6.1.

Microsoft explains the different .NET versions here:

So you are not switching to a lower level .NET when using .NET Standard 2.0. Microsoft will be releasing .NET 5 in November that will be all encompassing and replace the confusingly named .NET Cores and .NET Frameworks going forward (although I have no idea when Unity will upgrade to .NET 5).

I’m perfectly aware about .NET 5 and what is .NET Standard 2.0. I was more interested in why exactly this is the requirement for Entities package and what can go wrong if we continue to use .NET 4.x compatibility mode?

My understanding is that they are relying on newer features of C#, which isn’t compatible with .NET 4.x. .NET Standard 2 is helps with an easier to .NET Core and ultimately .NET 5, but it is likely still going to take some time.

.NET 4.7.x implements Standard 2.0, so in my opinion, the warning make no sense.

5 Likes

Still getting this in Unity 2019.4.8, Entities 0.11.1 and broke my builds by switching to .NET Standard 2 because I need access to the registry (on Windows). According to .NET Standard and Microsoft.Win32.Registry conflict Editor / Runtime (here on the forums), using .NET 4.x is the correct way when we need access to these APIs.

For what I’m doing with Entities / Burst so far, .NET 4.x does not seem to hurt. .NET Standard 2.0 does hurt a lot (breaks the builds).

So the warning really only seems confusing.

2 Likes