I'm trying to get elmah working in a c# console application.
I know it wasn't designed to work in console apps but I have noticed other people are doing it using some workarounds. I've looked at related posts and found an example of setting App.Config Here, but when I try inserting the configSections and elmah fragments I get Configuration Exceptions.
I've used elmah on many occasions in Web Applications and I think I just need to sort out the App.Config file. I may have put something in the wrong place.
Here is my App.Config file (with the connection string purposely hashed out)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<connectionStrings>
<add name="elmah-mysql" connectionString="###############" providerName="MySQL.Data" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<configSections>
<sectionGroup name="elmah">
<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>
<elmah>
<errorLog type="Elmah.MySqlErrorLog, Elmah" connectionStringName="elmah-mysql" />
</elmah>
</configuration>
Anyone spot where I've gone wrong?