mvc-mini-profiler

Using mvc-mini-profiler database profiling with Entity Framework Code First

亡梦爱人 提交于 2019-11-26 20:26:11
I'm using the mvc-mini-profiler in my project built with ASP.Net MVC 3 and Entity Framework code-first. Everything works great until I attempt to add database profiling by wrapping the connection in the ProfiledDbConnection as described in the documentation. Since I'm using a DbContext, the way I am attempting to provide the connection is through the constructor using a static factory method: public class MyDbContext : DbContext { public MyDbContext() : base(GetProfilerConnection(), true) { } private static DbConnection GetProfilerConnection() { // Code below errors //return

MvcMiniProfiler on EF 4.1 Code-First project doesn't profile SQL

倖福魔咒の 提交于 2019-11-26 19:20:54
问题 I have version 1.6 of the MvcMiniProfiler referenced (via Nuget) and have set everything up as described on the project homepage at http://code.google.com/p/mvc-mini-profiler/. I have the following code in the Web.config: <system.data> <DbProviderFactories> <remove invariant="MvcMiniProfiler.Data.ProfiledDbProvider" /> <add name="MvcMiniProfiler.Data.ProfiledDbProvider" invariant="MvcMiniProfiler.Data.ProfiledDbProvider" description="MvcMiniProfiler.Data.ProfiledDbProvider" type=