"无法确定提供者的名称和QUOT;误差MVC-迷你分析器1.9 [英] "Unable to determine the provider name" error with mvc-mini-profiler 1.9

查看:155
本文介绍了"无法确定提供者的名称和QUOT;误差MVC-迷你分析器1.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用实体框架,MVC-迷你分析器。从MVC-迷你分析器1.7升级到1.9版后的solving有些问题,我设法编译我的项目。现在,我得到以下运行时异常:

I am using entity framework with mvc-mini-profiler. After upgrading from mvc-mini-profiler 1.7 to version 1.9 and solving some issues, I managed to compile my project. Now I am getting the following runtime exception:

无法确定提供者的名称类型的连接MvcMiniProfiler.Data.EFProfiledDbConnection

Unable to determine the provider name for connection of type 'MvcMiniProfiler.Data.EFProfiledDbConnection'

我觉得这个问题可能与配置的DB提供的工厂,因为我有同样的问题与1.7版本,并通过添加以下到我的config文件解决了它有关:

I think the problem might be related with the configured db provider factories, because I had the same issue with version 1.7 and solved it by adding the following to my .config file:

<DbProviderFactories>
    <remove invariant="MvcMiniProfiler.Data.ProfiledDbProvider" />
    <add name="MvcMiniProfiler.Data.ProfiledDbProvider" 
         invariant="MvcMiniProfiler.Data.ProfiledDbProvider" 
         description="MvcMiniProfiler.Data.ProfiledDbProvider" 
         type="MvcMiniProfiler.Data.ProfiledDbProviderFactory, MvcMiniProfiler, Version=1.7.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3" />
</DbProviderFactories>

现在我试着用下面来替换上面,但我仍然得到错误:

Now I tried to replace the above with the following, but I still get the error:

<DbProviderFactories>
    <remove invariant="MvcMiniProfiler.Data.ProfiledDbProvider" />
    <add name="MvcMiniProfiler.Data.ProfiledDbProvider" 
         invariant="MvcMiniProfiler.Data.ProfiledDbProvider" 
         description="MvcMiniProfiler.Data.ProfiledDbProvider" 
         type="MvcMiniProfiler.Data.EFProfiledDbProviderFactory`1, MvcMiniProfiler.EntityFramework, Version=1.9.1.0, Culture=neutral, PublicKeyToken=b44f9351044011a3" />
</DbProviderFactories>

什么是正确的配置来解决这个问题?

What is the correct configuration to solve this issue?

推荐答案

你试过从您的.config删除DbProviderFactories?

Have you tried removing the DbProviderFactories from your .config?

你有初始化在那里呢?

protected void Application_Start()
{
    ....other code

    MiniProfilerEF.Initialize();
}

1.9,我刚添加的初始化启动,并删除了部分配置,现在我有EF SQL剖析。

With 1.9, I just added the Initialize in Start and removed the config section and now I have SQL profiling with EF.

这篇关于&QUOT;无法确定提供者的名称和QUOT;误差MVC-迷你分析器1.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆