Could not find stored procedure 'ELMAH_GetErrorsXml'

3.5k views Asked by At

I've installed Elmah.MVC nuget to my web application and got it up and running. I am able to see the error log when I have this xml tag <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />in my <elmah></elmah>.

What I am trying to do is log the errors in a SQL Server database, so I added this line <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ElmahConnection" /> and removed the old one. The ElmahConnection connection string points to an existing database in which I have successfully managed to create the table that Elmah requires and it has the stored procedures and everything. But when I try to access a non-existing page there are no logs in the table and when trying to reach /elmah.axd I get this

Could not find stored procedure 'ELMAH_GetErrorsXml'.

2

There are 2 answers

3
Martin Shishkov On

I finally managed to get it working by creating a new database and executing this script to it --> script. After that I granted my user permissions over that database.

0
Steve Greene On

My database objects were lost. I had to rerun the scripts to recreate the database objects and stored procedure. Older Google Doc links did not work, but found them here for version 1.2: https://elmah.github.io/downloads/