title: Where does Visual Studio (2010 Professional) host MDF files?
body: <p>I generated a database through entity framework. Here is the connection string:</p>
  
  <pre><code>&lt;add name="AnnouncementsContainer" connectionString="metadata=res://*/Models.Announcements.csdl|res://*/Models.Announcements.ssdl|res://*/Models.Announcements.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Database.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>This uses a file called <code>Database.mdf</code>. The application runs fine but there are two issues that I am having to deal with right now:</p>
  
  <ul>
  <li><strong>Database Updates:</strong> Whenever I update the database using raw sql code I have to manually host this file myself in SQL Server Management Studio (I then detach the database and leave the rest to visual studio). The server appears in the Visual Studio server explorer but Visual Studio cannot connect to it to run SQL code. <strong>Where is Visual Studio hosting this file so that the application can get to the database but the IDE can't?</strong></li>
  <li><strong>Profiling:</strong> I have created some stored procedures for entity framework and mapped them to the entities. It would be really nice to see if these entities are actually being executed. How can I see the stored procedures executing with a tool like SQL Profiler?</li>
  </ul>
  
  <p>Here are some screenshots in case what I am saying isn't clear:</p>
  
  <p>SQL Server Management Studio:</p>
  
  <p><img src="https://i.stack.imgur.com/3iPvR.jpg" alt="SQL Server Management Studio"></p>
  
  <p>Visual Studio Server Explorer:</p>
  
  <p><img src="https://i.stack.imgur.com/Ei3Gm.jpg" alt="Visual Studio Server Explorer"></p>