Will Mini Profiler Support EF6?


#1

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.


#2

See:

I thing @Yaakov_Ellis is working on it.


#3

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.


#4

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

Thx


#5

Will Miniprofiler.EF6 support .Net 4.0 ?


#6

The beta nuget for MiniProfiler.EF6 was just published. See the release page for more info.


#7

I am getting NullReferenceException:

[NullReferenceException: Referência de objeto não definida para uma instância de um objeto.]
StackExchange.Profiling.Data.EFProfiledDbProviderServices1.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(Action3 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(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList1& schemaCollection) +473 System.Data.Entity.Core.Metadata.Edm.Loader.LoadItems(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths) +163 System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable1 xmlReaders, IEnumerable1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer2& cachedCTypeFunction) +271
System.Data.Entity.Core.Metadata.Edm.StoreItemCollection…ctor(IEnumerable1 xmlReaders, IEnumerable1 filePaths) +316
System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader) +133
System.Lazy1.CreateValue() +14276544 System.Lazy1.LazyInitValue() +476
System.Data.Entity.Core.Metadata.Edm.<>c__DisplayClass7.b__4() +88
System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadAndCheckItemCollection(Func1 itemCollectionLoader) +17 System.Lazy1.CreateValue() +14276544
System.Lazy1.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.InternalSet1.Initialize() +72
System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext() +21 System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider() +68
System.Linq.Queryable.Where(IQueryable1 source, Expression1 predicate) +85


#8

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.

If you still see the issue, please post more details as an Issue in the GitHub repo along with repro instructions.


#9

I found the source of error. It isn´t compatible with 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


#10

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