NickG
NickG

Reputation: 9820

Can't see real error message of an ASP.NET application?

I have an almost blank ASP.NET website I've created (1 page). I've deliberately coded a divide by zero error on Page_Load. If the application pool is set to "ASP.NET 4.0 Pipeline: Integrated" then I do not see the page load error but instead I get:

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

The folder is set to be an application in IIS and the correct web.config entries to show errors are present, but for some reason, I cannot get .NET to show me the correct error message unless I change the applciation pool to ASP.NET Classic. Why is the "classic" mode necessary? I'm pulling my hair out as all other sites on the same machine are working OK (IIS7) and yet any new site I create seems to have this same problem.

Any idea what might be causing IIS to either not recognise this folder is an application or otherwise not display the correct error message?

EDIT: Web.Config is:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <customErrors mode="Off" />
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
</configuration>

Upvotes: 3

Views: 4127

Answers (1)

NickG
NickG

Reputation: 9820

OK, after fidding for a long time and comparing the setup to a working machine I've found that the answer actually lies with the settings of the .NET 4 application pool.

Once I checked "Enable 32-bit Applications" (see screenshot) in the advanced settings screen on IIS for the application pool, everything started behaving normally. I can only assume that something is installed somewhere which requires this setting in order for this application pool to work correctly and that was preventing me from seeing the real error message. I would still be interested to know if anyone finds out why this fixes the problem or how I can display the "real" error message which should display when attempt to use this app pool without "Enable 32-bit Applications" checked.

IIS App Pool Advanced Settings

Upvotes: 1

Related Questions