无法加载实体框架提供程序类型?我正在尝试在我的机器上安装的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>我在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' ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information..[03:59:11][IntegrationTests.CrudTest+QuestionTest.Create] at System.Data.Entity.Config.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName)
- 3 回答
- 0 关注
- 560 浏览
添加回答
举报
0/150
提交
取消