title: Can I make a constant from a compile-time env variable in csharp?
body: <p>We use <a href="http://hudson-ci.org/" rel="noreferrer">Hudson</a> to build our projects, and Hudson conveniently defines environment variables like "%BUILD_NUMBER%" at compile time.  </p>
  
  <p>I'd like to use that variable in code, so we can do things like log what build this is at run time.  However I CAN NOT do System.Environment.GetEnvironmentVariable because that is accessing the run-time environment, what I want is something like:</p>
  
  <pre><code>#define BUILD_NUM = %BUILD_NUMBER%
  </code></pre>
  
  <p>or</p>
  
  <pre><code>const string BUILD_NUM = %BUILD_NUMBER%
  </code></pre>
  
  <p>Except I don't know the syntax.  Can someone please point me in the right direction?  Thanks!</p>