mishrsud / mvc-mini-profiler

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

EF 1.9.1 without EdmMetadata seems to fail #112

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Does the EF Code First (v1.9.1) require EdmMetadata to work?  Since I am using 
a legacy database, I use:

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
       modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
    }

but now when I run 

    MvcMiniProfiler.MiniProfilerEF.Initialize();      

I get:

    Unable to determine the provider name for connection of type 'System.Data.SqlClient.SqlConnection'.

Is running without EdmMetadata supported?  Possible?

Original issue reported on code.google.com by scott.stafford on 23 Sep 2011 at 2:47

GoogleCodeExporter commented 8 years ago
Can you try in the latest version of code (git/googlecode not NuGet)?

Original comment by m...@developer.geek.nz on 27 Sep 2011 at 11:28

GoogleCodeExporter commented 8 years ago
Just tried it - I see no change.

Original comment by scott.stafford on 29 Sep 2011 at 5:29

GoogleCodeExporter commented 8 years ago
I'm having the same problem.

Using Entity Framework (Code First) 4.2.0.0 and MiniProfiler.EntityFramework 
1.9.1.0 (both NuGet packages). With or without the EdmMetadata table I get a 
"System.NotSupportedException: Unable to determine the provider name for 
connection of type 'System.Data.SqlClient.SqlConnection'."

Original comment by fberr...@gmail.com on 5 Dec 2011 at 10:10

GoogleCodeExporter commented 8 years ago
I tried getting the latest from source and compiling it myself. Used the 
Initialize_EF42() method. Still, no dice.

So, I rolled the EntityFramework NuGet package back to 4.1.10715.0 and now the 
profiler works fine. I'm guessing/hoping EF 4.2 support is on your list for the 
next release?

Original comment by fberr...@gmail.com on 9 Dec 2011 at 9:34

GoogleCodeExporter commented 8 years ago
I was able to profile successfully using the technique described here:

http://stackoverflow.com/questions/7666719/upgrading-to-mvcminiprofiler-1-9-from
-1-7-net-mvc3-and-ef-code-first

As far as I can tell (not understanding MvcMiniProfiler internals at all, this 
works by wrapping the connections "manually" just like the non-EF connections, 
rather than using the automagic of MiniProfilerEF.Initialize();

Original comment by scott.stafford on 14 Dec 2011 at 1:30