title: My only connection string is LocalSqlServer - Why is Web.config not loading when I run a test?
body: <p>I started an ASP.NET Web Application project in Visual Studio Community 2013 from the Empty template and ticked the Web API checkbox. I've installed SQL Server 2014 Express separately, and I've connected to my database under Server Explorer. Not sure if any of that's relevant.</p>
  
  <p>I'm trying to open a connection to my database using a connection string in Web.config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;clear /&gt;
      &lt;add name="DbConnection" connectionString="..."/&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I've attempted to access it a couple ways:</p>
  
  <pre><code>var connStr = System.Configuration.ConfigurationManager.ConnectionStrings["DbConnection"].ToString();
  
  var connStr = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
  </code></pre>
  
  <p>When I run a UnitTest, Everything I try pukes out a NullReferenceException.</p>
  
  <p>Taking a look at what's in ConfigurationManager.ConnectionStrings, all I find is machine.config's LocalSqlServer:</p>
  
  <p><img src="https://i.stack.imgur.com/6qW1M.png" alt="enter image description here"></p>
  
  <p>Why does it seem like Web.config isn't loading when I'm testing?</p>