An in-depth look at how to enable detailed error messaging with ColdFusion and IIS


Background - Understanding how to Configure IIS Configuration Settings

With IIS, there are two main ways to implement configuration changes:

  1. Using native Windows-based UI in IIS
  2. Changing the text-based properties of the web.config file stored in one of the web directories

You only need to make changes using one of these two methods.

If you use the IIS Windows-based interfaces to make changes to the site configuration, it will automatically change the properties in the web.config file in the root directory of the site that you are modifying.
The same is true if you modify the web.config file and restart IIS- the configuration settings in the web.config file will match the configuration properties shown in the Windows-based UI.

However, each folder can have its own unique IIS configuration settings that are set by a web.config file found in the folder.
If there are multiple web.config files found within a site, the configuration properties set by the web.config file found in the particular folder will override other settings found in the web.config file of the parent site folder. As we will see- this is an important concept to remember when applying configuration settings.


Enable Detailed Error Messages with IIS 


Using the Native Windows UI in IIS

  1. Open IIS
  2. Right-click on 'Error Pages' and select 'Open Feature'
  3. Click on the 'Edit Feature Settings' link to the right of the page
  4. Click on the 'Detailed Errors' radio button and click OK to close the dialog

Editing the web.config File

  1. Open Windows Explorer
  2. Find the web.config file in the root directory and back it up with a different name
  3. Open the original web.config file
  4. Add the following line inside of the system.Webserver section
    <httpErrors errorMode="Detailed" existingResponse="PassThrough" />

  5. Restart IIS

ColdFusion Settings

  1. Open the ColdFusion Administrator
  2. Click on Debugging
  3. Check the 'Enable Robust Exception Information' checkbox

If Detailed Error Messages Are Still Not Showing with ColdFusion

If you are not getting detailed error messages with ColdFusion, even after setting show detailed errors in IIS and enabling robust information in ColdFusion, check to see if you have multiple web.config files. If you do have multiple inadvertent web.config files in sub-directories- delete them!

I ran into this issue while migrating my site to Media3.net when I copied multiple web.config files when I consolidated several sites. The duplicate web.config file overwrote the IIS configuration settings that I applied on the parent site and IIS never passed the errors to ColdFusion.

This issue drove me a bit crazy until I found the duplicate web.config file, and it prompted me to write this article, even though there are other articles showing how to enable robust error information with ColdFusion. 


Further Reading: