I\'m trying to use the mvc-mini-profiler with EFCodeFirst I\'m creating a DbProfiledConnection and passing it to the DbContext on construction as below. The application continu
I suspect this relates to the static field initializer. Connections on web apps should never be static anyway (but request-specific at most).
The key is: what does ProfiledDbConnection actually come out as? The Get method returns a ProfiledDbConnection only if you are currently profiling (on the current request), and the connection is profiled against the MiniProfiler instance on that request.
If you use a static field, then there are two scenarios:
MiniProfiler.Current is null