MiniProfilerEF.Initialize() could not be initialized properly

倾然丶 夕夏残阳落幕 提交于 2019-12-01 17:26:08

问题


I just started trying out the mvc-mini-profiler in my MVC3 project with EF4.1 and after changing MiniProfilerEF.Initialize(); to MiniProfilerEF.Initialize_EF42(); I'm getting :

A null was returned after calling the 'GetService' method on a store provider instance of type 'MvcMiniProfiler.Data.EFProfiledOdbcProviderFactory'. The store provider might not be functioning correctly.

This method MiniProfilerEF.Initialize(); - was giving me

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

So I've replaced dll's with ones I've manually built from the source.

What could be the problem in here ?


回答1:


If it helps, the EF team have release a beta preview with a fix for the error

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

See http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-release-candidate-available.aspx

You can get it from Nuget using

PM> Install-Package EntityFramework.Preview

I just tested it on my build and it fixes the issue meaning you can just call MiniProfilerEF.Initialize(); as before instead of the new method.




回答2:


Please analyze what version of Entity Framework your application is using PM> Get-Package

and then install MiniProfiler.EF accordingly

Like in my case I installed Install-Package MiniProfiler.EF5



来源:https://stackoverflow.com/questions/7784680/miniprofileref-initialize-could-not-be-initialized-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!