title: EF6 and MSTest in TeamCity: Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance
body: <p>I've run into some issues with MSTest when they're run inside teamcity. When I run them inside VisualStudio on local machine, everything works good.</p>
  
  <blockquote>
    <p>[08:05:21][ProjName.Data.Tests.HistoryTableHandlingTest.HistoryProgressTest] <strong>Class Initialization method ProjName.Data.Tests.HistoryTableHandlingTest.Init threw exception.</strong> System.InvalidOperationException: System.InvalidOperationException: <strong>The 'Instance' member of the Entity Framework provider type</strong> 'System.Data.Entity.SqlServer.<strong>SqlProviderServices</strong>, <strong>EntityFramework.SqlServer</strong>, Version=<strong>6.0.0.0</strong>, Culture=neutral, PublicKeyToken=b77a5c561934e089' <strong>did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'</strong>. <strong>Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider.</strong> This may be because the provider does not support Entity Framework 6 or later; see <a href="http://go.microsoft.com/fwlink/?LinkId=260882" rel="nofollow">http://go.microsoft.com/fwlink/?LinkId=260882</a> for more information..</p>
  </blockquote>
  
  <p>Here's my app.config for MSTest project:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral" requirePermission="false" /&gt;
    &lt;/configSections&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v11.0" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Another thing that I'd like to mention is, that I don't use EntityFramework library from NuGet, but it's clone EntityFramework.HierarchyId (it can be found in NuGet as well).</p>