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?