{"id":8189,"date":"2015-11-30T00:51:35","date_gmt":"2015-11-30T00:51:35","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/30\/entity-framework-provider-type-could-not-be-loaded-open-source-projects-laravel-framework\/"},"modified":"2022-08-30T15:45:32","modified_gmt":"2022-08-30T15:45:32","slug":"entity-framework-provider-type-could-not-be-loaded-open-source-projects-laravel-framework","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/30\/entity-framework-provider-type-could-not-be-loaded-open-source-projects-laravel-framework\/","title":{"rendered":"Entity Framework Provider type could not be loaded?-open source projects laravel\/framework"},"content":{"rendered":"<p>I am trying to run my tests on TeamCity which is currently installed on my machine.<\/p>\n<p><code>System.InvalidOperationException: System.InvalidOperationException<\/code>:<\/p>\n<p>The Entity Framework provider type &#8216;<code>System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer<\/code>, <code>Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'<\/code> for the &#8216;<code>System.Data.SqlClient<\/code>&#8216; ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application.<\/p>\n<p>See http:\/\/go.microsoft.com\/fwlink\/?LinkId=260882 for more information..<\/p>\n<p>I have no reference to <code>System.Data.Entity<\/code> in any of my projects as was suggested on codeplex for upgrading to EF6.<\/p>\n<p>So, I am not sure why am I getting this exception. I do not get any such exception when I run the tests from VS.<\/p>\n<p>I did try to set CopyLocal to false then again to true.. but that does not seem to work either.<\/p>\n<p>Update<\/p>\n<p>My app.config has the following . Does this cause some behavior that I don&#8217;t understand ?<\/p>\n<pre><code>\n\n  \n    \n    \n  \n  \n    \n  \n\n<\/code><\/pre>\n<p>I get the following stacktrace in teamcity .<\/p>\n<pre><code>[MSTest] IntegrationTests.CrudTest+QuestionTest.Create\n[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..\n[03:59:11]\n[IntegrationTests.CrudTest+QuestionTest.Create]     at System.Data.Entity.Config.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName)\n   at System.Data.Entity.Config.ProviderServicesFactory.GetInstanceByConvention(String providerInvariantName)\n   at System.Data.Entity.Config.DefaultProviderServicesResolver.GetService(Type type, Object key)\n   at System.Data.Entity.Config.CachingDependencyResolver.c__DisplayClass1.b__0(Tuple`2 k)\n   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\n   at System.Data.Entity.Config.CachingDependencyResolver.GetService(Type type, Object key)\n   at System.Data.Entity.Config.ResolverChain.c__DisplayClass3.b__0(IDbDependencyResolver r)\n   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()\n   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\n   at System.Data.Entity.Config.ResolverChain.GetService(Type type, Object key)\n   at System.Data.Entity.Config.RootDependencyResolver.GetService(Type type, Object key)\n   at System.Data.Entity.Config.ResolverChain.c__DisplayClass3.b__0(IDbDependencyResolver r)\n   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()\n   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\n   at System.Data.Entity.Config.ResolverChain.GetService(Type type, Object key)\n   at System.Data.Entity.Config.CompositeResolver`2.GetService(Type type, Object key)\n   at System.Data.Entity.Config.IDbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key)\n   at System.Data.Entity.Config.InternalConfiguration.GetService[TService](Object key)\n   at System.Data.Entity.Config.DbConfiguration.GetService[TService](Object key)\n   at System.Data.Entity.Utilities.DbProviderFactoryExtensions.GetProviderServices(DbProviderFactory factory)\n   at System.Data.Entity.Infrastructure.DefaultManifestTokenService.GetProviderManifestToken(DbConnection connection)\n   at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest&amp; providerManifest)\n   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)\n   at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)\n   at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)\n   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()\n   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\n   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()\n   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()\n   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)\n   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)\n   at System.Data.Entity.DbSet`1.Add(TEntity entity)\n   at EFRepository.Infrastructure.EFRepository`1.Add(T item) in c:\\TeamCity\\buildAgent\\work\\da2ea4e72c0e77f0\\Repository\\Infrastructure\\EFRepository.cs:line 22\n   at IntegrationTests.CrudTest.Initialize() in c:\\TeamCity\\buildAgent\\work\\da2ea4e72c0e77f0\\IntegrationTests\\CrudTest.cs:line 34\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to run my tests on TeamCity which is currently installed on my machine. System.InvalidOperationException: System.InvalidOperationException: The Entity Framework provider type &#8216;System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242; for the &#8216;System.Data.SqlClient&#8216; 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.. I have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-8189","post","type-post","status-publish","format-standard","hentry","category-laravel","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8189"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8189\/revisions"}],"predecessor-version":[{"id":8550,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8189\/revisions\/8550"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}