Add the email to your Web.Release.config. My Web.config database does not contain any Elmah materials at all - all this is added when compiling with the release. If you compile for release and run locally, it will send email and register, but there will be no regular debug build.
Web.Release.config
<configSections> <sectionGroup name="elmah" xdt:Transform="Insert"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /> <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /> <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" /> <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" /> </sectionGroup> </configSections> <connectionStrings> <clear/> <add xdt:Transform="Insert" name="ErrorLogs" connectionString="...." /> </connectionStrings> <elmah xdt:Transform="Insert"> <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLogs" /> <security allowRemoteAccess="0" /> <errorMail ...Email options ... /> </elmah> <system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> <httpModules xdt:Transform="Insert"> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /> <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /> </httpModules> </system.web> <system.webServer> <modules xdt:Transform="Insert" runAllManagedModulesForAllRequests="true"> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /> <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /> </modules> </system.webServer> </configuration>
Finally, it should be noted that your base Web.config should have a <configSections> at the beginning, even if it is empty:
Web.config
<configuration> <configSections /> ....
source share