2013-11-28 2 views
5

ho cercato di filo-up un MiniProfiler a un progetto esistente che ha usato il codice EF6 prima, aaaand semplicemente mi fa impazzire adesso :)MiniProfiler con EntityFramework 6 Codice primo

Il problema è che di default MiniProfiler lavora con EF 4.1 e 6.0 hanno implementato il tipo di soluzione rapida https://github.com/SamSaffron/MiniProfiler/pull/134

Ma sembra che non funzioni per me. Ogni Sto lanciando applicazione che ho appena ottenere la seguente eccezione:

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. 

Qualcuno ha affrontato problema simile? Grazie!

risposta

4

Il nuget EF6 è stato pubblicato. E 'disponibile here e può essere installato utilizzando Install-Package MiniProfiler.EF6 -Pre

Per inizializzare, è sufficiente chiamare il seguente nella vostra logica di avvio dell'applicazione:

using StackExchange.Profiling.EntityFramework6; 

... 

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

assicurarsi di chiamare prima di usare EF in alcun modo.