2013-11-28 12 views
5

Ich habe einen Miniprofiler zu einem bestehenden Projekt Draht-up versucht, den ersten EF6-Code verwendet, uuuuund es macht mich verrückt jetzt :)Miniprofiler mit EntityFramework 6 Code ersten

Das Problem ist, dass Miniprofiler standardmäßig arbeitet mit EF 4.1, und für 6.0 haben sie Art der schnellen Lösung implementiert https://github.com/SamSaffron/MiniProfiler/pull/134

Aber scheint wie es funktioniert nicht für mich. Jedesmal, wenn ich Anwendung gestartet bin ich immer nur die folgende Ausnahme:

System.InvalidOperationException: The Entity Framework provider type 'StackExchange.Profiling.Data.EFProfiledSqlClientDbProviderServices, MiniProfiler.EntityFramework6' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. 

Hat jemand ähnliches Problem konfrontiert? Vielen Dank!

Antwort

4

Das EF6 nuget wurde veröffentlicht. Es ist here zur Verfügung und kann mit Install-Package MiniProfiler.EF6 -Pre

installiert werden zu initialisieren, rufen Sie einfach die folgenden in Ihrer Anwendung Startlogik:

using StackExchange.Profiling.EntityFramework6; 

... 

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

Seien Sie sicher, dass dies rufen, bevor EF in irgendeiner Weise verwenden.

Verwandte Themen