mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Still doesn't work with EF Code First #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install mvc mini profiler and mini profiler ef from nuget
2. Update web.config with the DbProviderFactories section
3. Wire up mini profiler

var factory = new 
SqlConnectionFactory(ConfigurationManager.ConnectionStrings["NorthwindContext"].
ConnectionString);
var profiled = new MvcMiniProfiler.Data.ProfiledDbConnectionFactory(factory);
Database.DefaultConnectionFactory = profiled;

What is the expected output? What do you see instead?
Would like to profile the SQL, but mini profiler only shows the standard 
report, no sql profiling.  I changed the connection string name per this SO 
answer: 
http://stackoverflow.com/questions/6757659/mvcminiprofiler-on-ef-4-1-code-first-
project-doesnt-profile-sql/6800657#6800657 .  But, I get the error mentioned by 
Gavin in the comments to answer, that the database doesn't exist because EF 
doesn't let the connection factory set the database name.  I can't change the 
database name, this is an existing database.  Still stuck and unclear on the 
proper way to wire up SQL profiling with EF.

What version of the product are you using? On what operating system?
1.8

Please provide any additional information below.

Original issue reported on code.google.com by rwilli...@gmail.com on 28 Aug 2011 at 3:39

GoogleCodeExporter commented 8 years ago
Can you try latest MiniProfiler.EF (1.9.1) be sure to read the front page

Original comment by sam.saff...@gmail.com on 29 Aug 2011 at 12:26

GoogleCodeExporter commented 8 years ago
Magical, that did it.  Works both for database first and code first, and even 
with multiple databases in the same app.  Thanks!

Original comment by rwilli...@gmail.com on 29 Aug 2011 at 2:48

GoogleCodeExporter commented 8 years ago

Original comment by sam.saff...@gmail.com on 6 Sep 2011 at 7:51

GoogleCodeExporter commented 8 years ago
Thank you for detailed instruction, everything workz!

Original comment by resad.za...@gmail.com on 22 Sep 2011 at 8:46