title: environment variable as partial path in app.config
body: <p>I have an environment variable that points to a folder where development code is located. On my machine it is C:\SOME_NAME\CODE. This environment variable is referenced in code, as other computers using the same code have a different path for the same environment variable. I cannot be sure of directory or drive names or even number of levels. I am trying to use relative path in an app.config, but I was unable to get it to work. </p>
  
  <pre><code>&lt;setting name="manifestpath" serializeAs="String"&gt;
     &lt;value&gt;$(CODE_BASE)\PROJECT\manifest\manifest.xml&lt;/value&gt;
  &lt;/setting&gt;
  </code></pre>
  
  <p>When I run it, I get an error <code>"Could not find a part of the path C:\SOME_NAME\CODE\PROJECT\output\x64\Debug\$(CODE_BASE)\PROJECT\manifest\manifest.xml".</code></p>
  
  <p>I am aware that the exact question has been asked here:
  <a href="https://stackoverflow.com/questions/5303113/app-config-settings-environment-variable-as-partial-path">App.config settings, environment variable as partial path</a>.<br>
  Unfortunately, I was unable to find an answer that works, I have tried to use % (but my env var doesn't have % in name, and I can't change it because the change would affect lots of other projects and people). Help ? Thank you.</p>