SamSaffron/MiniProfiler

MiniProfiler does not work with Entity Framework 6 and breaks the application if it is upgraded to EF6.

Closed this issue · 4 comments

Entity Framework 6 has done some architectural changes as outlined in the following two URLs.

Updating Applications to use EF6 - http://entityframework.codeplex.com/wikipage?title=Updating%20Applications%20to%20use%20EF6

Rebuilding EF providers for EF6 - http://entityframework.codeplex.com/wikipage?title=Rebuilding%20EF%20providers%20for%20EF6

This causes MiniProfiler to break the application due to incompatibilities with the newly moved base classes and the new provider model.

It breaks like this (using a DbContext):

Unable to cast object of type 'StackExchange.Profiling.Data.EFProfiledDbConnection' to type 'System.Data.SqlClient.SqlConnection'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidCastException: Unable to cast object of type 'StackExchange.Profiling.Data.EFProfiledDbConnection' to type 'System.Data.SqlClient.SqlConnection'.

I think it would be necessary to create a separate project for EF6 integration since it is not backwards compatible. Also at the moment it only supports .NET 4.5.

Here is a working sample project using EF5 and MiniProfiler which exhibits this behavior as soon as it is upgraded to use EF6: http://sdrv.ms/XUzWpA

However you feel you would like to fix it, go for it. A separate EF6 project sounds fine.

As for .NET 4.5, only the new EF6 would have to target that, right? The base StackExchange.Profiling dll could stay 4.0?

Thanks!

Yes. Only the EF6 project would have to target .net 4.5.

Sent from my Windows Phone


From: Jarrod Dixonmailto:notifications@github.com
Sent: ‎8.‎3.‎2013 18:21
To: SamSaffron/MiniProfilermailto:MiniProfiler@noreply.github.com
Cc: Stefán Jökull Sigurðarsonmailto:stefanjokull@hotmail.com
Subject: Re: [MiniProfiler] MiniProfiler does not work with Entity Framework 6 and breaks the application if it is upgraded to EF6. (#129)

However you feel you would like to fix it, go for it. A separate EF6 project sounds fine.

As for .NET 4.5, only the new EF6 would have to target that, right? The base StackExchange.Profiling dll could stay 4.0?

Thanks!


Reply to this email directly or view it on GitHub:
#129 (comment)

I have issued a pull request for this feature.

Closing this issue. EF6-Beta1 support has now been merged into MiniProfiler.