我从nuget包管理控制台安装了elmah.mvc.2.1.2。我运行了脚本ELMAH-1.2-db-SQLServer.sql
来修改数据库。
configuration
的{{1}}部分我添加了
web.config
我知道<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah.SqlServer" connectionStringName="DefaultConnection"/>
</elmah>
适用于我们在应用中执行的所有操作。
我编写了一个引发错误的动作DefaultConnection
。抛出错误但数据库中没有输入。当我导航到/Home/TestError
时,我收到错误/elmah
我从包管理器控制台重新安装了Elmah,但它没有任何区别。 bin文件夹中没有Could not load file or assembly 'Elmah.SqlServer' or one of its dependencies.
,因此我无法手动添加引用。
答案 0 :(得分:1)
SqlErrorLog位于Elmah程序集中(不是Elmah.SqlServer)。请尝试以下方法:
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="DefaultConnection"/>
</elmah>