Turn IIS7 HTTP Error Handling Off?
After some more extensive searching, I found the answer here:
The solution is to manually edit your web.config file with this custom "httpErrors" entry:
<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <httpErrors existingResponse="PassThrough" /> </system.webServer></configuration>
However, due to IIS 7.0 "lockdown" feature you might get a "This configuration section cannot be used at this path. This happens when the section is locked at a parent level." error. To solve that, execute the following in the command prompt:
cd C:\Windows\System32\inetsrvappcmd unlock config /section:httpErrors
In IIS Manager -> Site -> Error Pages, right-click each error page and choose ‘Remove’.
Unfortunately there is not a way to tell IIS not to interfere from the script side, so it's always an annoying deployment issue.