0

On localhost I have set custom error mode off in web.config. There is no Application_Error method in global.asax. I have also commented HandleErrorAttribute in filter.config, but still I am not getting detailed error message / yellow screen of err / stacktrace in my ASP.NET MVC app.

System.web section in web.config:

<system.web>
    <caching>
        <outputCache enableOutputCache="false" />            
    </caching>
    <globalization culture="auto" uiCulture="auto" />
    <customErrors  mode="Off" />
    <compilation targetFramework="4.5" debug="true" />
    <httpRuntime targetFramework="4.5" maxRequestLength="524288000" executionTimeout="3600" requestLengthDiskThreshold="524288000" maxQueryStringLength="204800" maxUrlLength="409600" enable="true" />
</system.web>

I have this line of config in system.webserver:

<system.webServer>
    <httpErrors errorMode="Detailed"/>

But when I execute simple code shown here in the HomeController's Index action method, it is redirecting to the /Home/Error page instead of showing yellow error page or detailed error page:

public ActionResult Index(string returnUrl)
{
    int b = 0;
    int a = 5 / b;

    ViewBag.Message = "Welcome BP DHC Application.";
    ViewBag.ReturnUrl = returnUrl;

    return View();
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.