1

I have a strange problem with EF5 and mini profiler. Basically I have created a really simple project using the Blog/Post example.

If i do a linq command (for example, debug.writeline mycontext.Blogs.Count()) it works the first time, but then the second time around I get:

Unable to cast object of type 'StackExchange.Profiling.Data.EFProfiledDbConnection' to type 'System.Data.SqlClient.SqlConnection'.

And the only way to resolve this is to rebuild the app.

Any ideas?

Stono
  • 2,337
  • 2
  • 16
  • 18

1 Answers1

3

Changing my initialisation to MiniProfilerEF.Initialize_EF42() and moving it to the top of my App_Start sorted it

Stono
  • 2,337
  • 2
  • 16
  • 18