0%
Loading...
NolimitHost

FiveM for GTAV Enhanced: C# Runtime Patch Notes - August 20

This is the first patch dedicated entirely to the C# scripting runtime for FiveM for GTAV Enhanced, rolling up a round of sandbox, native interop, and threading fixes reported through the GitHub Discussions page.

For C# resource developers: update your CitizenFX NuGet packages to the latest version to pick up these changes.

Below is the full breakdown of everything in this patch.

Sandboxing Improvements

  • Servers can now partially disable C# sandboxing while in developer mode by setting sv_devMode 1 and sv_enableCoreclrSandboxing 0.
  • The C# API whitelist has been extended and improved.
  • Selected NuGet packages are now allowed under sandboxing, including Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.DependencyInjection, Microsoft.EntityFrameworkCore, and Npgsql.
  • Multidimensional arrays can be constructed again instead of being blocked.
  • Protected base calls on virtual methods work again instead of being blocked, which had been causing Object.Finalize errors (#91, #270, #390).

Native Interop Fixes

  • Native invocation errors now return a readable message instead of a bare SEHException (#330).
  • Native calls with out and ref arguments can now be invoked correctly, instead of not working at all (#123, #282, #309, #325, #330).
  • Native calls now accept null arguments again instead of throwing an "Unsupported type String" error, including passing null for optional string parameters (#231, #423).
  • Native struct arguments are now populated correctly instead of arriving empty.

Threading Fixes

  • JumpToMainThread now resumes on the main thread in the scenarios where it previously did not (#343).
  • Commands and events now run on the correct thread in cases where they previously did not, though this still logs a warning for now (#223).

Resource Loading Fixes

  • Resources load again when a CitizenFX.Core.Server or CitizenFX.Core.Client NuGet from Legacy is present in the resource directory, instead of failing with an unsafe assembly error (#44).
  • Resources containing multiple DLLs now load instead of crashing the client with a duplicate key error (#305).
  • Resources that only use APIs from CitizenFX.FiveM.Shared no longer fail with a "Cannot find Entrypoint class" error.

New Module APIs

The new module includes several welcome additions:

  • A proper StateBag API.
  • API.EveryTick and the [OnTick] attribute are now available.
  • The ColShape API is now available in the new module.

Additional Fixes

  • Event calls with non-numeric source values are now handled correctly instead of throwing a FormatException, including NUI callback sources (#257).
  • Assemblies compiled with <Nullable>disable</Nullable> can now mark all reference-type arguments optional with [assembly:AllowNullArguments], and mark required arguments with [Required] (#351).

How to Update

C# resource developers should update their CitizenFX NuGet packages to the latest version to pick up these changes. For the client, the update is delivered automatically through the FiveM for GTAV Enhanced client — restart to receive it.

The Cfx.re team continues to actively monitor the GitHub Discussions page during early access. If you encounter any remaining issues, reporting them there gives the team the best chance of addressing them quickly.

Get premium FiveM server hosting with DDoS protection

Explore FiveM Hosting Visit Help Center