# Will Mini Profiler Support EF6?

**URL:** <https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19>\
**Category:** .NET\
**Created:** [July 12, 2013, 3:02am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19 "2013-07-12T03:02:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/michael/32/993_2.png) [@Michael](https://community.miniprofiler.com/u/Michael)\
**Post date:** [July 12, 2013, 3:02am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/1 "2013-07-12T03:02:52Z")

</div>

I noticed that some code had been checked into Github to support EF6. Is this now working? Could we get a nuget packages for it?

Thanks,  
Michael.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [December 2, 2013, 11:35pm UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/2 "2013-12-02T23:35:03Z")

</div>

See:

> <https://twitter.com/Yaakov/status/398120650151190528>

I thing @Yaakov_Ellis is working on it.

---

<div class="post-metadata">

**Author:** ![Yaakov\_Ellis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/yaakov_ellis/32/961_2.png) [@Yaakov\_Ellis](https://community.miniprofiler.com/u/Yaakov_Ellis)\
**Post date:** [December 5, 2013, 8:52am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/3 "2013-12-05T08:52:09Z")

</div>

That’s right. The EF6 work is done and tested. Problem is that we cant release a new nuget for it until a few last items are finished up in the main package for miniprofiler v3.x (current nuget is still on v2.x). In the meantime, you are welcome to take the current code on nuget for a test-spin.

---

<div class="post-metadata">

**Author:** ![Fujiy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fujiy/32/969_2.png) [@Fujiy](https://community.miniprofiler.com/u/Fujiy)\
**Post date:** [February 4, 2014, 6:08pm UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/4 "2014-02-04T18:08:22Z")

</div>

I really need it. Do you have any date to release a fix?

Thx

---

<div class="post-metadata">

**Author:** ![LordMike](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/lordmike/32/975_2.png) [@LordMike](https://community.miniprofiler.com/u/LordMike)\
**Post date:** [February 4, 2014, 6:11pm UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/5 "2014-02-04T18:11:22Z")

</div>

Will Miniprofiler.EF6 support .Net 4.0 ?

---

<div class="post-metadata">

**Author:** ![Yaakov\_Ellis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/yaakov_ellis/32/961_2.png) [@Yaakov\_Ellis](https://community.miniprofiler.com/u/Yaakov_Ellis)\
**Post date:** [February 5, 2014, 9:39am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/6 "2014-02-05T09:39:01Z")

</div>

The beta nuget for [MiniProfiler.EF6](https://www.nuget.org/packages/MiniProfiler.EF6/) was just published. See the [release page](https://github.com/MiniProfiler/dotnet/releases/tag/v3.0.10-beta) for more info.

---

<div class="post-metadata">

**Author:** ![Fujiy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fujiy/32/969_2.png) [@Fujiy](https://community.miniprofiler.com/u/Fujiy)\
**Post date:** [February 5, 2014, 11:14am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/7 "2014-02-05T11:14:30Z")

</div>

I am getting NullReferenceException:

> [NullReferenceException: Referência de objeto não definida para uma instância de um objeto.]  
> StackExchange.Profiling.Data.EFProfiledDbProviderServices`1.GetDbProviderManifest(String manifestToken) in d:\Files\GitHub\miniprofiler\dotnet\StackExchange.Profiling.EntityFramework6\EFProfiledDbProviderServices.cs:62 System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifest(String manifestToken) +294 System.Data.Entity.Core.Metadata.Edm.Loader.InitializeProviderManifest(Action`3 addError) +211  
> System.Data.Entity.Core.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader) +231  
> System.Data.Entity.Core.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader reader) +272  
> System.Data.Entity.Core.SchemaObjectModel.SchemaElement.Parse(XmlReader reader) +107  
> System.Data.Entity.Core.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader reader) +50  
> System.Data.Entity.Core.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader, String sourceLocation) +1157  
> System.Data.Entity.Core.SchemaObjectModel.Schema.Parse(XmlReader sourceReader, String sourceLocation) +212  
> System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection) +473 System.Data.Entity.Core.Metadata.Edm.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths) +163 System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer`2& cachedCTypeFunction) +271  
> System.Data.Entity.Core.Metadata.Edm.StoreItemCollection…ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths) +316  
> System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader) +133  
> System.Lazy`1.CreateValue() +14276544 System.Lazy`1.LazyInitValue() +476  
> System.Data.Entity.Core.Metadata.Edm.\<\>c\_\_DisplayClass7.b\_\_4() +88  
> System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadAndCheckItemCollection(Func`1 itemCollectionLoader) +17 System.Lazy`1.CreateValue() +14276544  
> System.Lazy`1.LazyInitValue() +476 System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace, Boolean required) +153 System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace) +18 System.Data.Entity.Core.Objects.ObjectContext.InitializeMappingViewCacheFactory(DbContext owner) +61 System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory) +798 System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel() +89 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +408 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.Infrastructure.DbQuery`1.System.Linq.IQueryable.get\_Provider() +68  
> System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +85

---

<div class="post-metadata">

**Author:** ![Yaakov\_Ellis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/yaakov_ellis/32/961_2.png) [@Yaakov\_Ellis](https://community.miniprofiler.com/u/Yaakov_Ellis)\
**Post date:** [February 9, 2014, 8:36am UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/8 "2014-02-09T08:36:06Z")

</div>

Please make sure that you are using the -beta2 nuget for MiniProfiler and the -beta3 nuget for MiniProfiler.EF6.

Also, please make sure that you have properly defined a system.data \> DbProviderFactories section in your web.config. See the Sample.MVC project for [an example of this](https://github.com/MiniProfiler/dotnet/blob/master/Sample.Mvc/Web.config#L83).

If you still see the issue, please post more details as an [Issue in the GitHub repo](https://github.com/MiniProfiler/dotnet/issues/new) along with repro instructions.

---

<div class="post-metadata">

**Author:** ![Fujiy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/fujiy/32/969_2.png) [@Fujiy](https://community.miniprofiler.com/u/Fujiy)\
**Post date:** [February 18, 2014, 12:50pm UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/9 "2014-02-18T12:50:48Z")

</div>

I found the source of error. It isn´t compatible with EFProf ([http://www.hibernatingrhinos.com/products/EFProf](http://www.hibernatingrhinos.com/products/EFProf))

I am using MiniProfiler beta6 + MiniProfiler.EF6 beta 4 + EfProf 2.0.2233.0. When EFProf is active, MiniProfiler generates this error:

Unable to define EFProfiledDbProviderServices class of type ‘ProfiledDbProviderServices’. Please check that your web.config defines a section underneath \<system.data\>.

**UPDATE (since I can´t reply anymore…):**

MiniProfiler is trying to access the Instance field/property of class ProfiledDbProviderServices. What doesn´t exists.

MiniProfiler.EF6 uses the old interception method with reflection or the new Interception/Log API?

If using the old method, maybe you need to unwrap ProviderServices in loop, until find the real one. For example in MiniProfilerEF6, WrapProviderService method. If I register MiniProfiler first, it works. The problem is, EFProf by default register it using WebActivator, what happens first

---

<div class="post-metadata">

**Author:** ![Yaakov\_Ellis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/yaakov_ellis/32/961_2.png) [@Yaakov\_Ellis](https://community.miniprofiler.com/u/Yaakov_Ellis)\
**Post date:** [February 27, 2014, 1:58pm UTC](https://community.miniprofiler.com/t/will-mini-profiler-support-ef6/19/10 "2014-02-27T13:58:14Z")

</div>

Thanks for the update. Sorry that it isn’t working for you, but it looks like the issue is more related to EfProf.
