【问题标题】:Elmah MVC Could not load file or assembly Elmah.SqlServerElmah MVC 无法加载文件或程序集 Elmah.SqlServer
【发布时间】:2016-06-28 06:43:09
【问题描述】:

我从 nuget 包管理控制台安装了 elmah.mvc.2.1.2。我运行脚本ELMAH-1.2-db-SQLServer.sql 来修改数据库。

我添加到web.configconfiguration 部分

<elmah>
    <errorLog type="Elmah.SqlErrorLog, Elmah.SqlServer" connectionStringName="DefaultConnection"/>
</elmah>

我知道DefaultConnection 适用于我们在应用中执行的所有其他操作。

我编写了一个引发错误的操作/Home/TestError。抛出错误,但在数据库中没有输入。当我导航到 /elmah 时,我收到错误 Could not load file or assembly 'Elmah.SqlServer' or one of its dependencies.

我从包管理器控制台重新安装了 Elmah,但没有任何区别。 bin 文件夹中没有Elmah.SqlServer,所以我无法手动添加引用。

【问题讨论】:

    标签: model-view-controller elmah


    【解决方案1】:

    SqlErrorLog 位于 Elmah 程序集(不是 Elmah.SqlServer)中。请尝试以下操作:

    <elmah>
        <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="DefaultConnection"/>
    </elmah>
    

    【讨论】:

    • 谢谢@ThomasArdal。那只是票。
    • 没问题@Vague :) 我正在开发一个 ELMAH 配置验证器,但目前,这种配置的 IntelliSense 将为您提供帮助:blog.elmah.io/the-elmah-schema
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-11
    • 2016-08-16
    • 2019-09-06
    • 2020-08-17
    相关资源
    最近更新 更多