.NET 6 and the future of mono

Hi! I’m currently checking out Unity as potential tool for my next game. With the imminent release of .NET 6, I’m curious to know if Unity is going to switch or add support for it eventually. Over time, many libraries will be switching to this and it will make it very difficult for Unity projects to reference new packages. There’s also the new C# language versions that are just impossible to use in Unity right now and this is one of the biggest reasons why I haven’t switched yet. I understand completely that this is a very complex task and that the immediate results aren’t super attractive, but the longer Unity takes to update, the longer it’s going to take to get back to up-to-date tools when absolutely needed. Mono has many known issues which includes performance and security. Now, is there any progress made in this direction? Can the community do anything to help? Is there an open source repository where people could contribute?

Unity has always slowly but surely upgraded their .NET compiler/runtime. The most recent jump can be seen by comparing these:

I don’t know of any official roadmap or open-source repo that one could contribute to. But it’s happening.

1 Like

Good to know, but unfortunately not all C# features are available in the mono implementation and things like AssemblyLoadContext are only available in dotnet 5-6

.Net 6 supports fewer platforms than Unity does. That’s a big problem. I have doubts Microsoft will be a lot of help porting .Net 6 over to PS5 or the Nintendo Switch for example.

Even if Unity were to do all that work themselves, you can’t expect Unity to be able to stay on the bleeding edge of .Net releases. .Net 6 doesn’t even have a full release yet.

2 Likes

Read this thread: https://discussions.unity.com/t/836646

2 Likes

This announcement has Unity mentioned: Announcing .NET 6 - The Fastest .NET Yet - .NET Blog
Is there any news from Unity to support .net 6?

2 Likes

From this thread :
We don’t expect to target .NET 6 in Unity soon. We are working on it though, see this link: https://forum.unity.com/threads/unity-future-net-development-status.1092205

They could enable .NET 6 only on supported platforms, and fall back to Mono on others. .NET 6 is available in a major chunk of market share (Windows, Linux, OS X, iOS and Android), and IMO developers that target these platforms shouldn’t wait for the rest of the platforms to catch up to reap the benefits of .NET 6.

1 Like