相关疑难解决方法(0)

无法加载实体框架提供程序类型?

我正在尝试在我的机器上安装的TeamCity上运行我的测试.

System.InvalidOperationException:

实体框架提供程序类型" 为" 'ADO.NET提供程序无法加载.确保提供程序程序集可用于正在运行的应用程序.System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServerVersion=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'System.Data.SqlClient

有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=260882.

我没有参考System.Data.Entity任何我在codeplex上建议升级到EF6的项目.

所以,我不知道为什么我会得到这个例外.当我从VS运行测试时,我没有得到任何这样的异常.

我确实尝试将CopyLocal设置为false然后再次设置为true ..但这似乎也不起作用.

更新

我的app.config有以下内容.这会导致一些我不理解的行为吗?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
</configuration>
Run Code Online (Sandbox Code Playgroud)

我在teamcity中得到以下stacktrace.

[MSTest] IntegrationTests.CrudTest+QuestionTest.Create
[03:59:11][IntegrationTests.CrudTest+QuestionTest.Create] Initialization method IntegrationTests.CrudTest+QuestionTest.Initialize threw exception. System.InvalidOperationException: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' for the 'System.Data.SqlClient' …
Run Code Online (Sandbox Code Playgroud)

c# mstest entity-framework teamcity-7.1 entity-framework-6

406
推荐指数
11
解决办法
26万
查看次数