实体框架事件探查器 - ASP.NET MVC4与EF 6 -Unable以确定提供者的名称 [英] Entity Framework profiler - ASP.NET MVC4 with EF 6 -Unable to determine the provider name
问题描述
我一直在使用EF 6在我的ASP.NET MVC4项目,而现在没有任何问题。
I've been using EF 6 in my ASP.NET MVC4 project for a while now without any issues.
问题出现时,我加入实体框架探查到项目中,然后突然我得到以下错误:无法确定型'System.Data.SqlClient.SqlClientFactory供应商工厂提供者的名称确保ADO.NET提供程序安装或应用程序配置的注册。
The problem comes in when I add Entity Framework Profiler to the project, then suddenly I get the following error: "Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config."
我已经尝试了一些建议,包括一个问题,即EntityFramework.SqlServer.dll是不是在bin文件夹present。
I've tried a couple of suggestions including an issue where the "EntityFramework.SqlServer.dll" was not present in the bin folder.
堆栈跟踪:
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文件:
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>
连接细节:
<add name="MyProject" connectionString="Server=.\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
任何想法是什么引起的?
Any ideas what's causing this?
注:
- 我利用ninject的处理依赖注入
- 我最近升级到了6.0.1 EF
推荐答案
这是由实体框架事件探查器中的错误造成的,已经固定在建2214(参见:的 http://hibernatingrhinos.com/builds/uber-prof-v2/2214 )
This was caused by a bug in Entity framework profiler and has been fixed in build 2214 (See :http://hibernatingrhinos.com/builds/uber-prof-v2/2214)
这篇关于实体框架事件探查器 - ASP.NET MVC4与EF 6 -Unable以确定提供者的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!