MiniProfiler with EntityFramework 6 code first


I have tried to wire-up a MiniProfiler to an existing project which used EF6 code first, aaaand it just makes me crazy now :)

The problem is that by default MiniProfiler works with EF 4.1, and for 6.0 they have implemented kind of quick solution

But seems like it doesnt works for me. Everytime I'm launching application I just getting the following exception:

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 for more information.

Did anybody faced similar issue? Thank you!

Popular Answer

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

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

using StackExchange.Profiling.EntityFramework6;


protected void Application_Start()

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

Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why