ReSharper 2025.3 Help

Code inspection: Loading from a non-readonly static field is not supported

This inspection reports reads from static fields or static auto-properties that are not readonly inside code compiled by the Burst compiler.

Burst can read constants and readonly static data, but loading mutable static state is not supported.

Example

In this example, the counter field is declared as static but not readonly. Reading it inside a Burst-compiled job is not supported.

using Unity.Burst; using Unity.Jobs; [BurstCompile] public struct ExampleJob : IJob { private static int counter = 1; public void Execute() { // Reported: loading a non-readonly static field is not supported var value = counter; } }
using Unity.Burst; using Unity.Jobs; [BurstCompile] public struct ExampleJob : IJob { public int counter; public void Execute() { // Correct: Pass the value into the job var value = counter; } }

Quick-fix

This inspection does not provide a dedicated quick-fix. Fix it manually by removing the mutable static read or by making the data Burst-compatible (for example, using readonly static data, constants, or passing the value into the job).

26 March 2026