title: Setup of mvc-mini-profiler for EF-db- first
body: <p>I'm trying to use the mini-profiler with old-style EF code - database-first.</p>
  
  <p>So far:</p>
  
  <ul>
  <li><p>I've created a db context using:</p>
  
  <pre><code>    string connectionString = GetConnectionString();
      var connection = new EntityConnection(connectionString);
      var profiledConnection = ProfiledDbConnection.Get(connection);
      _context = profiledConnection.CreateObjectContext&lt;MyEntitiesType&gt;();
  </code></pre></li>
  <li><p>but then I hit a "Unable to find the requested .Net Framework Data Provider. It may not be installed."
  which I worked around using a <code>&lt;system.data&gt;</code> reference to the MvcMiniProfiler provider:</p>
  
  <pre><code> &lt;system.data&gt;
     &lt;DbProviderFactories&gt;
       &lt;remove invariant="MvcMiniProfiler.Data.ProfiledDbProvider" /&gt;
       &lt;add name="MvcMiniProfiler.Data.ProfiledDbProvider" invariant="MvcMiniProfiler.Data.ProfiledDbProvider" description="MvcMiniProfiler.Data.ProfiledDbProvider" type="MvcMiniProfiler.Data.ProfiledDbProviderFactory, MvcMiniProfiler" /&gt;
      &lt;/DbProviderFactories&gt;
    &lt;/system.data&gt;
  </code></pre></li>
  <li><p>but now I'm hitting a stack overflow somewhere in <code>C:\Users\sam\Desktop\mvc-mini-profiler\MvcMiniProfiler\Data\ProfiledDbProviderServices.cs</code>. Looking at the <a href="http://code.google.com/p/mvc-mini-profiler/source/browse/MvcMiniProfiler/Data/ProfiledDbProviderServices.cs" rel="nofollow">latest source</a> I'm wondering if I've somehow got the setup wrong for this - if somehow my profiled connection is containing another profiled connection is containing....</p></li>
  </ul>
  
  <p>Any help/advice?</p>
  
  <hr>
  
  <p>Update - looking at <a href="http://code.google.com/p/mvc-mini-profiler/wiki/FrequentlyAskedQuestions" rel="nofollow">http://code.google.com/p/mvc-mini-profiler/wiki/FrequentlyAskedQuestions</a> at least one other person has seen the same sort of problem with 1.7 - although (s)he's doing code first. I'll keep playing to see if I can work out what to do...</p>