title: How to use web.config when unit testing an asp .net application
body: <p>I am starting out with unit testing, I have a method that uses the web.config for a connection string.</p>
  
  <p>I was hoping to be able to use</p>
  
  <pre><code>[DeploymentItem("web.config")]
  </code></pre>
  
  <p>to get the web config file, this still leaves me with null reference exceptions (that'd be what I write my next test for).</p>
  
  <p>How do I use the config file included with the project I am trying to test?</p>
  
  <p>I am using the testing framework included in VS 2008, if that makes any difference.</p>
  
  <p>Thanks</p>