.NET 6 for resources?

So in a thread awhile ago which I’m having trouble finding dbub mentioned that you can use up to .NET 6 to write C# resources. Thing is though that https://docs.fivem.net/docs/scripting-manual/runtimes/csharp/ states

"After selecting the project type, make sure you set the Framework version to **.NET Framework 4.5.2** (somewhere at the bottom of the window, see the highlighted areas in the screenshot above). Yes, this is **not** the latest version, but this specific version is required for your resource to work correctly".

I’ve tried creating a .NET 5.0 class library but the CitizenFX.Core dlls aren’t targeting .NET core and above so when I build I get this warning
warning NU1701: Package 'CitizenFX.Core.Client 1.0.4998' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project

I know that any .NET dll can reference libraries to lower versions and the runtime for thatr version spins up alongside and should be fine so I’m not worried about that. But given the warning being displayed I thought I’d ask here.

I’d like to run with .NET 5 and ultimately 6 due to the performance tuning efforts which have gone into these recent framework versions. In particular Entity Framework Core 5 and Core 6 are reportedly much more opimitsed than the Net Framework version 6. In real terms though, does this warning stating there may be compatibilities play out to there being problems or can we comfortably run .NET 5/6 ?

Client does not and will likely never support any of the modern profiles until MSFT gets sane again and defines profiles that make sense to sandbox, it’s not ‘4.5.2’ either*, old guides people wrote usually targeted that as a) running Roslyn targeting net46 would emit code depending on a type that wasn’t exposed and b) there wasn’t any set of reference assemblies available like the newer SDK projects use.

This docs guide you linked seems a little very old, but since whoever wrote it back then put a lot of effort in we’ve not been able to update it as it’d not be able to match that effort (pictures and all), and the person who initially wrote it and PR’d it has long since moved on.

Server has a pending upgrade sometime but should handle netstandard2.0 TFM fine, this wasn’t updated for a while as there were some memory corruption issues with any framework using newer corefx libs.

Since you’re mostly asking about performance, however, this doesn’t really matter much for typical in-game scenarios. EFCore versions targeting netstandard2.0 also work fine on server, FWIW.

*) To be precise, client framework exposes the Silverlight 5 BCL profile with some additions for basic parts of the 4.5 (tasks, mainly) and 4.6 (compiler compat) BCLs added to the ‘allowed stuff’ profile, on top of a Mono 4.8(?) fork. This could technically be updated but since Mono moved to be part of .NET all the BCL libraries got changed and we currently don’t have anyone capable of redoing the sandboxing attribute stuff that was done before, since MSFT gave up on .NET sandboxing support.

Thanks so much for the detailed response. I’ll switch my client back then to 4.8. I guess it is more the server side where the performance is more critical. So what’s the upshot if all that then, should I target netstandard 2.0 or can I go with net core 3 or higher?

Actually I followed the link from your response to the CitizenFX.Templates process. Nice stuff, definitely takes the guessing out of the mix. So are these templates actively maintained and will be updated if newer .NET frameworks are supported?

Also I see that given it’s netstandard2.0 then there’s a limit of EntityFramework due to the fact that you can’t link to later .NET frameworks. Looking forward to the future server update.

Somewhat, yes - you’ll have to update the version reference in the header however, of course.

I’m not entirely sure which header you’re referring to

The generated projects contain a version number in the Sdk= field.

Oh the project files, I see what you mean.
As time goes on though how do we ascertain which is the latest supported .net version that we can safely use? I figured what these templates generate would be the latest supported.