title: How to avoid recompiling assemblies when changing constant values? (C#)
body: <p>I'm trying to figure a way to have a static class with constant strings that doesn't force recompilation when values from this class changes.</p>
  <p>I've read in this <a href="https://stackoverflow.com/questions/1724025/whats-the-best-way-to-store-a-group-of-constants-that-my-program-uses#comment1602984_1724041">highly voted comment</a> that:</p>
  <blockquote>
  <p>... if you change a (const) value you must also recompile all assemblies dependent on your assembly defining the constants - therefore its often safer to go the readonly route.</p>
  </blockquote>
  <p>So I did a short experiment to check if it's true.</p>
  <p>I have 4 projects: <code>Program</code>, <code>ProjectA</code>, <code>ProjectB</code> &amp; <code>ProjectC</code>. Each &quot;ProjectX&quot; has a single class &quot;X&quot; while program stores main.</p>
  <p>In C I have a single <code>public const string someString = &quot;some const string&quot;</code>, which is referenced by a public method in <code>B</code>, which in turn is referenced by a public method in <code>A</code>, and <code>A</code>'s method is called by <code>Program.Main</code>.</p>
  <p>Whether I make <code>someString</code> a <code>const</code>, a <code>static readonly</code>, a getter only expression bodied property or a getter only property with a property initializer, <strong>all the projects get rebuilt no matter what</strong>.</p>
  <p>So is it true that I can have a <strong>static</strong> class that holds readonly string values that won't propagate recompilations to all depending projects once it's value is changed?</p>