I’m trying to get started with a prototype that uses the latest C# language features and .NET 6 SDK, so I installed Unity 2022.2 Alpha 13 and was disappointed to learn that my VS project file still generates with a ‘TargetFrameworkVersion’ of 4.7.1…
I’m assuming that this is because the Mono bundled with 2022.2 Alpha 13 does not include the Unity Mono fork that supports .NET 6.0?
What do I need to do in order to upgrade my copy of 2022.2 Alpha 13 with the latest Unity Mono fork?
If this is not the solution to achieve what I’m after, then what is?
I’ve read all the threads on here and I’m still confused what the current state of 2022.2 Alpha 13 is for .NET 6 integration… Documentation on how this is meant to work is virtually non existent for the alpha, so I don’t understand how you expect developers to test .NET 5 & 6 runtimes/features.
Is .NET 6 features only working for Il2Cpp at the moment?
If the Unity Mono fork does not currently support .NET 6, then how do I replace it with CoreCLR so I CAN use .NET 6?
My end goal is that my CS Proj file generated by this alpha build should show a Language Version of 10.0 and a TargetFramework of NET Standard 2.1, or Net 6.0, NOT 4.7.1…
There needs to be a serious documentation task that addresses this, either by creating an instructional thread on the Alpha build forum / this forum and linking it in the Mono Upgrade manual.
I’m sorry that you are experiencing these issues. However, Unity at 2022.2 alpha does not support .NET 6 as a build target. So it is not possible to accomplish what you are attempting.
You can select “.NET Standard” as the API Compatibility Level option, in which case you will get access to the .NET Standard 2.1 API.
You can find more details about Unity’s plans for .NET 6 (and later) support in a GDC talk posted in this thread: GDC 2022: The Future of .NET and Unity
We have not yet discussed release dates for this support though.
Even when I select .NET Standard, for the 2.1 API, the CSProj file generated will still have a TargetFrameworkVersion of 4.7.x… So, am I misunderstanding how something works here?
Why is it that the build target cannot be changed to 5 or 6 for Unity?
I’m not sure how important TargetFrameworkVersion for a Unity CSProj file?
Moving the Unity ecosystem to .NET 5 or 6 is a bit of a long process. You can watch the talk I linked to or check on this ongoing mega-thread for many more details: https://discussions.unity.com/t/836646
So I did as described in the manual for Unity, then I checked the project file produced by Unity and the TargetFrameworkVersion remains the same still, as NET Framework 4.7!
Shouldn’t the generator be creating a .NET Standard 2.1 project file?
I’ve read a lot and understand you’re hard at work upgrading to .NET 6+ and I want to know how I can create a barebones .NET Standard 2.1 project…
I should add that I have tried manually setting the framework by replacing the with a element instead, and put in the value Net Standard 2.1 – I have no idea how this is suppose to work, can you please provide guidance on what the expectations are here??