title: NUnit and App.config
body: <p>I try test my Entity class, but i always get a Failure:</p>
  
  <blockquote>
    <p><em><code>System.Data.MetadataException</code>:<br/>
    Unable to load the specified metadata resource.</em></p>
  </blockquote>
  
  <p>I think the problem is in connection string and <code>App.config</code>. I try a lot of stuff: add something to build events, changing config name, copy the config file into solution folder, project folder, project_folder/bin/debug, again change a lot of names... but it still doesn't work.</p>
  
  <p>I have a "AppProject" solution containing 3 projects:</p>
  
  <ul>
  <li>"Entity"</li>
  <li>"WebTest"</li>
  <li>"MVCApp"</li>
  </ul>
  
  <p>The Entity project has a <code>.edmx</code> file, and simple POCO classes. When I add the connection string from the <code>Entity/App.config</code> into <code>MVCApp/Web.config</code>, the "MVCApp" and database works fine.</p>
  
  <p>When I copy the <code>Entity/App.config</code> into <code>WebTest/App.config</code> it doesn't work. I don't know where the problem is.</p>
  
  <p>I use a Visual NUnit, but when I try turn on in NUnit still doesn't work.</p>
  
  <p>My <code>App.config</code>:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="UserDB"
         connectionString="metadata=res://*/Model.Entity.csdl|
                                    res://*/Model.Entity.ssdl|
                                    res://*/Model.Entity.msl;
                           provider=System.Data.SqlClient;
                           provider connection string=
                                    &amp;quot;Data Source=.\SQLExpress;
                                    Initial Catalog=TestDB;
                                    Integrated Security=True;
                                    MultipleActiveResultSets=True&amp;quot;"
         providerName="System.Data.EntityClient" /&gt;
    &lt;!-- NOTE: line breaks in the above connection string have been inserted only
               for better legibility. --&gt;
  &lt;/connectionStrings&gt;
  </code></pre>