Troubleshooting Failed Request Tracing XML Rendering Issues in IIS 7.5: Classic ASP Debugging


2 views

When working with Failed Request Tracing (FRT) in IIS 7.5 for Classic ASP debugging, you might encounter this frustrating scenario:

// What you expect to see:
Blue-colored FRT interface with categorized error information

// What you actually get:
Raw XML content displaying as plain text in IE

The issue typically stems from these technical aspects:

  • Missing XSLT transformation due to incorrect MIME type handling
  • Internet Explorer security settings blocking local content
  • Improper file association for .xml files
  • Missing style sheet reference in the XML header

Here are actionable fixes I've verified through production debugging:

1. Registry Fix for MIME Type (Run as Administrator):
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.xml]
"Content Type"="text/xml"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/xml]
"Extension"=".xml"
"CLSID"="{48123BC4-99D9-11D1-A6B3-00C04FD91555}"
"Encoding"=hex:08,00,00,00

When registry edits aren't possible, process the XSLT manually:

// PowerShell script to transform XML
$xml = New-Object System.Xml.XmlDocument
$xml.Load("C:\inetpub\logs\FailedReqLogFiles\W3SVC1\fr000001.xml")

$xsl = New-Object System.Xml.XmlDocument
$xsl.Load("C:\Windows\System32\inetsrv\freb.xsl")

$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($xsl)
$xslt.Transform($xml, "output.html")

For IE security restrictions, try these methods:

  • Add the log file location to Trusted Sites zone
  • Enable "Display mixed content" in Security settings
  • Use the Mark of the Web workaround by adding this to the XML header:
    <!-- saved from url=(0014)about:internet -->

Check these IIS settings through appcmd:

appcmd list config -section:system.webServer/tracing/traceFailedRequests

Ensure the path to freb.xsl is correct in your XML file's processing instruction:

<?xml-stylesheet type='text/xsl' href='freb.xsl'?>

When working with IIS 7.5's Failed Request Tracing for debugging Classic ASP applications, you might encounter an issue where the XML logs appear as raw text in Internet Explorer instead of the expected formatted interface with the blue theme. This occurs despite having all the proper tracing features installed and configured.

The root cause typically stems from missing or incorrect MIME type associations in IIS for XML files. When IE receives an XML file, it needs proper instructions on how to render it. The tracing XSL stylesheet that transforms the raw XML into the friendly interface isn't being applied.

First, verify your IIS configuration with these commands in an elevated command prompt:

appcmd list config -section:system.webServer/tracing/traceFailedRequests
appcmd list config -section:system.webServer/staticContent

Add the correct MIME type for XML files in IIS:

appcmd set config /section:staticContent /+"[fileExtension='.xml',mimeType='text/xml']"

Alternatively, you can do this through IIS Manager:

  1. Open IIS Manager
  2. Select the server node
  3. Open "MIME Types"
  4. Add extension ".xml" with type "text/xml"

If the MIME type fix doesn't work, you can manually apply the XSLT transformation. Here's a PowerShell script to process the XML:

$xml = New-Object System.Xml.XmlDocument
$xml.Load("C:\inetpub\logs\FailedReqLogFiles\W3SVC1\fr000001.xml")

$xsl = New-Object System.Xml.XmlDocument
$xsl.Load("C:\Windows\System32\inetsrv\freb.xsl")

$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load($xsl)

$writer = New-Object System.IO.StringWriter
$xslt.Transform($xml, $null, $writer)
$writer.ToString() | Out-File "formatted_output.html"

For an immediate solution while debugging, you can force IE to use the correct rendering:

function viewFailedRequestLog(xmlFile) {
    var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
    xmlDoc.async = false;
    xmlDoc.load(xmlFile);
    
    var xslDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
    xslDoc.async = false;
    xslDoc.load("C:\\Windows\\System32\\inetsrv\\freb.xsl");
    
    return xmlDoc.transformNode(xslDoc);
}

To ensure this doesn't happen again, add this to your web.config:

<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".xml" mimeType="text/xml" />
    </staticContent>
</system.webServer>