無法加載實體框架提供程序類型?我正在嘗試在我的機器上安裝的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有以下內(nèi)容。這會導致一些我不理解的行為嗎?<?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 關注
- 589 瀏覽
添加回答
舉報
0/150
提交
取消