Why after changing a static readonly field via reflection the output of that readonly field is old?
Why is the "someValue" variable which is readonly (but we still can change its value via reflection) output as "10", although it actually did change to 55? static class Program { static readonly int someValue = 10; static void Main(string[] args) { Console.WriteLine(someValue); // 10 typeof(Program) .GetField("someValue", BindingFlags.Static | BindingFlags.NonPublic) .SetValue(null, 55); // change readonly field via reflection to 55 Console.WriteLine(someValue); // output in console 10, // but in visual studio debugger it shows 55 Console.ReadKey(); } } Probably just a JIT optimization to