Problem Reporting Configuration

Problem Reporting Configuration

This page describes steps to configure problem reporting feature.

Problem reporting configuration is stored in external file, which is linked from web.config.

First there has to be config section added to the web.config file:

Config section in web.config

<configSections>
    <section name="problemReportingSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</configSections>
<problemReportingSettings file="problemReporting.config"/>

Content of problem reporting configuration file is following:

problemReporting.config

<problemReportingSettings>
  <add key="fromMail" value="no-reply@asap.is"/>
  <add key="toMail" value="name@domain.cz"/>
</problemReportingSettings>

There are two keys specifying parameters for the e-mails sent via problem reporting feature. toMail contains address, to which problems reports are sent. fromMail key contains address, which will appear as a sender in the sent problem report.

Finally, the smtp configuration has to be specified (http://msdn.microsoft.com/en-us/library/ms164240(v=vs.110).aspx and http://msdn.microsoft.com/en-us/library/ms164242(v=vs.110).aspx)

  <system.net>
    <mailSettings>
      <smtp from=no-reply@service.com">
        <network host="smtp.mailservice.com" port="25" userName="my-mail-username" password="my-mail-password" />
      </smtp>
    </mailSettings>
  </system.net>

Make sure that the “fromMail” from <problemReportingSettings> is authorized to send emails from the defined smtp server. Note, that <smtp> “from” email address is not used for problem reporting!

When sending a mail via smtp fails, the mail is attempted to send by “mailto” functionality via default e-mail client program, but in that case the mail is without details (no backtrace) and is sent to address <support@asap.is.> This mail address can’t be changed by configuration. That is a fallback functionality.