ApiCompatibilityLevelTest

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.

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

.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)

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 .

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.

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

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.

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.

1 Like

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. Unity - Manual: .NET profile support

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. Use .NET 4 and later versions in Unity | Microsoft Learn

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!

This is not true. VS works fine as will most other assets.