سؤال

I have updated EF5 to 6 and MiniProfiler.Ef to 2.0.3

I am having issues to run the application now. As per the suggestion by https://github.com/SamSaffron/MiniProfiler/pull/142 I have updated my Web.Config to access the MiniProfiler Provider for the EntityFramework.

But the MiniProfiler.EntityFramework doesn't have a method named EFProfiledSqlClientDbProviderServices and I couldn't find a method which returns System.Data.Entity.Core.Common.DbProviderServices

Could anyone please help me to fix the issue to connect EntityFramework6 with MiniProfiler.Ef

Side note I am using StructureMap for depedency injection.

هل كانت مفيدة؟

المحلول

The EF6 nuget has been published. It is available here and can be installed using Install-Package MiniProfiler.EF6 -Pre

In order to use it you will need to also install MiniProfiler v3 (your question references the old repository).

To initialize, simply call the following in your application startup logic:

using StackExchange.Profiling.EntityFramework6;

...

protected void Application_Start()
{
    MiniProfilerEF6.Initialize();
}

Be sure to call this before using EF in any way.

نصائح أخرى

Entity Framework 6 support wasn't officially released yet. You can find the code in StackExchange.Profiling.EntityFramework6 project on github with instruction here.

I have an issue in that after loading MiniProfiler and MiniProfiler.EnitiyFramework6. MiniProfiler runs fine, but when I add to my Applcation_Start in Global.asax

MiniProfilerEF6.Initialize();

I get this:

An exception of type 'System.IO.FileLoadException' occurred in MiniProfiler.EntityFramework6.dll but was not handled in user code

Additional information: Could not load file or assembly 'MiniProfiler, Version=3.0.11.0, Culture=neutral, PublicKeyToken=b44f9351044011a3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top