2013-11-28 34 views
5

我試圖線了MiniProfiler到第一次使用EF6代碼的現有項目,aaaand它只是讓我瘋了現在:)MiniProfiler用的EntityFramework 6碼第一

的問題是,在默認情況下MiniProfiler與工作EF 4.1和6.0,他們已經實施了一種快速解決方案https://github.com/SamSaffron/MiniProfiler/pull/134

但似乎它不適用於我。 每次我啓動應用程序,我剛開了以下異常:

System.InvalidOperationException: The Entity Framework provider type 'StackExchange.Profiling.Data.EFProfiledSqlClientDbProviderServices, MiniProfiler.EntityFramework6' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. 

有沒有人遇到過類似的問題? 謝謝!

回答

4

EF6 nuget已經發布。它可here並且可以使用Install-Package MiniProfiler.EF6 -Pre

要初始化安裝,只需調用應用程序中的啓動邏輯如下:

using StackExchange.Profiling.EntityFramework6; 

... 

protected void Application_Start() 
{ 
    MiniProfilerEF6.Initialize(); 
} 

務必以任何方式使用EF之前調用此。

相關問題