EF 4.1 Update 1 had an error in it with regards to profiling that has now been fixed and I am trying to get profiling working using MySql with EF 4.2 Code First.
I tried putting
MiniProfilerEF.Initialize();
in my application start but received the error
Unable to find the requested .Net Framework Data Provider. It may not be installed.
http://code.google.com/p/mvc-mini-profiler/
EF 4.1 Update 1
Note, that EF 4.1 Update 1 (version currently on NuGet) has a breaking change which throws the following error when specifying a connection string:
The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
MiniProfiler attempts to resolve this issue by detecting the version of EntityFramework that it is running against. If this doesn't work (due to security exceptions), force the hack to be applied by replacing the Initialize() call with:
MiniProfilerEF.Initialize_EF42(); // in Application_Start
However, this is currently unable to profile SqlCE or Oracle databases.
To work around this an additional parameter has been added to the Initialize call:
If you specify connection strings explicitly in your web.config, use
MiniProfilerEF.Initialize();
. This will not profile SqlCE or Oracle databases If you don't specify connection strings (automatically inferred) and want SqlCE support, useMiniProfilerEF.Initialize(false);
. Note, this should be a temporary solution until EF 4.2 is widely available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With