Troubleshooting IIS 7.5 HTTP 500 Internal Server Error with Empty Event Logs in ASP.NET MVC3 Deployment


2 views

Few things are more frustrating than encountering a 500 error with no trace in the Event Viewer. Here's my systematic approach to diagnosing this stealthy issue:

// First, enable detailed error messages in web.config
<system.webServer>
    <httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
    <customErrors mode="Off" />
</system.web>

Before diving deep, verify these common pitfalls:

  • File permissions on the /bin folder (IIS_IUSRS needs read/execute)
  • Missing DLL dependencies (use Process Monitor to track file access)
  • Corrupted web.config (try validating with XML tools)

When standard methods fail, these advanced approaches often reveal the truth:

// Enable Failed Request Tracing
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/tracing /enabled:"true" /commit:apphost
%windir%\system32\inetsrv\appcmd.exe set site "YourSiteName" -traceFailedRequestsLogging.enabled:"true" /commit:apphost

Create a tracing rule for status code 500:

  1. Open IIS Manager → Sites → Your Site
  2. Under "IIS" section, double-click "Failed Request Tracing Rules"
  3. Add rule for "All content (*)" with status code 500

Here's a handy script I use to gather diagnostic information quickly:

# Check IIS application pools
Get-ChildItem IIS:\AppPools | Where-Object {$_.State -ne "Started"} | Format-Table Name, State

# Verify HTTP.sys configuration
netsh http show servicestate

# Check for pending reboots
Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"

ASP.NET MVC3 has specific requirements that might cause silent failures:

// Ensure proper assembly bindings in web.config
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

If you're still stuck, try creating a minimal test application:

  1. Create new empty ASP.NET MVC3 project
  2. Gradually migrate components from your broken app
  3. Test after each migration to identify the breaking change

Remember to check the Windows Application log with elevated privileges (Run as Administrator) as some entries might only be visible to administrators.


When you see a generic 500 error with no corresponding event log entries, it feels like hitting a brick wall. The server knows something's wrong but refuses to tell you what. Here's how I systematically approach this issue:

First, modify your web.config to get more detailed errors:

<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed" />
  </system.webServer>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
  </system.web>
</configuration>

IIS 7.5's Failed Request Tracing is often the key to solving these silent issues:

# Enable from command line:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/tracing /enabled:"true" /commit:apphost

# Configure tracing rules:
%windir%\system32\inetsrv\appcmd.exe configure trace "YourSiteName" /enable /path:/* /statusCodes:500

Silent 500s often stem from permission issues. Verify these critical permissions:

  • Application pool identity has read/execute rights to:
    • Website root folder
    • Temporary ASP.NET files (%WINDIR%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files)
    • System temp folder
  • Check for proper NTFS inheritance

Problematic modules often cause silent failures. Create a test web.config that removes all modules:

<system.webServer>
  <modules runAllManagedModulesForAllRequests="false">
    <clear/>
    <add name="StaticFileModule" />
  </modules>
  <handlers>
    <clear/>
    <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" />
  </handlers>
</system.webServer>

When all else fails, use Sysinternals Process Monitor to track:

  • ACCESS DENIED errors
  • Missing DLLs or configuration files
  • Registry permission issues

I once spent hours debugging a silent 500 error that turned out to be an invalid URL rewrite rule. The solution was to add this to web.config:

<system.webServer>
  <rewrite>
    <rules>
      <rule name="Test Rule" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        </conditions>
        <action type="Rewrite" url="index.php" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>

When standard methods fail, try these advanced approaches:

  • Enable ETW tracing for ASP.NET:
    logman start aspnet -p {AFF081FE-0247-4275-9C4E-021F3DC1DA35} -o aspnet.etl -ets
  • Check HTTPERR logs at %SystemDrive%\Windows\System32\LogFiles\HTTPERR
  • Enable W3C logging with additional fields (sc-status, sc-substatus)