Entity Framework profiler - ASP.NET MVC4 with EF 6 -Unable to determine the provider name

asp.net-mvc-4 c# entity-framework-6 profiler

Question

I've been using EF 6 in my ASP.NET MVC4 project without any problems for a time now.

The issue arises when I include Entity Framework Profiler in the project since I then unexpectedly receive the following error: "The provider name for the provider factory of type 'System.Data.SqlClient.SqlClientFactory' could not be determined. Ensure that the application configuration has the ADO.NET provider installed or registered."

I've tried a few solutions, including one for the "EntityFramework.SqlServer.dll" problem that occurred when it wasn't in the bin folder.

the stack trace

System.Data.Entity.Config.DefaultInvariantNameResolver.GetService(Type type, Object key) +440
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +83
System.Data.Entity.Config.CachingDependencyResolver.GetService(Type type, Object key) +179
System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
System.Data.Entity.Config.CompositeResolver`2.GetService(Type type, Object key) +71
System.Data.Entity.Config.IDbDependencyResolverExtensions.GetService(IDbDependencyResolver resolver, Object key) +84
System.Data.Entity.Internal.InternalConnection.get_ProviderName() +112
System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context) +120
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +319
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues) +40

Web.config:

  <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="v11.0" />
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>

Connection information

<add name="MyProject" connectionString="Server=.\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />

Anyone know the cause of this?

Notes:

  • To manage dependency injection, I'm using ninject.
  • My most recent upgrade is to EF 6.0.1.
1
2
11/11/2013 9:36:48 AM

Accepted Answer

Build 2214 fixes the problem that caused this in Entity Framework Profiler (See :http://hibernatingrhinos.com/builds/uber-prof-v2/2214)

4
11/12/2013 4:32:30 PM

Popular Answer

Just a suggestion. If you add Glimpse ef6 to your project, this problem may also occur.

As soon as I installed Glimpse EF6, I encountered this issue. Glimpse EF6's removal fixed the problem.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow