There are many questions about this subject , but none (except one but still a short one) are dealing with the following scenario.
From C# 4 book:

Marc also wrote :
if you change the value of a const, you need to rebuild all the
clients
Question :
1) Why is that? Are both static readonly and const— static?
2) Where actually the values are saved ?
3) How does making a field static readonly actually solve this problem “behind the scene” ?
no, a const is a const, not a static – it is a special-case, with different rules; it is only set at compile-time (not runtime), and it is handled differently
the crux here is what the following means:
vs
in the first case, it reads the value at runtime from
SomeType, i.e. via aldsfld; however, in the second case, that is compiled to the value, i.e. ifConstValuehappens to be123, then the second is identical to:at runtime, the fact that it came from
SomeTypedoes not exist, as the value (123) was evaluated by the compiler, and stored. Hence it needs a rebuild to pick up new values.Changing to
static readonlymeans that the “load the value fromSomeType” is preserved.So the following:
compiles as:
Note that in the
Bar, theldcis loading a value directly (0x1c8 == 456), withTestcompletely gone.For completeness, the const is implemented with a static field, but – it is a literal field, meaning: evaluated at the compiler, not at runtime.