Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6976929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:33:36+00:00 2026-05-27T17:33:36+00:00

I have configured an error 500 page with a controller an a view to

  • 0

I have configured an error 500 page with a controller an a view to display when a 500 occures via the webconfig.

   <httpErrors errorMode="Custom" existingResponse="Replace">
        <remove statusCode="404" />
        <remove statusCode="500" />
        <error statusCode="404" responseMode="ExecuteURL" path="/error/404" />
        <error statusCode="500" responseMode="ExecuteURL" path="/error/500" />
    </httpErrors>

In the application_error event i log the error

    protected void Application_Error(object sender, EventArgs e)
    {
        var objErr = Server.GetLastError().GetBaseException();
        var err = string.Concat("Error in: ", Request.Url, "\nMessage:", objErr.Message, "\nStack Trace:", objErr.StackTrace);
        DatabaseLogging.WriteLog(err, 3);
    }

On my dev envirement it works perfect, the exception is logged and the error page is shown. On the acceptance envirment the 500 error page is show, but the real error is not logged. The following error gets logged.

Message:The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched:  ~/Views/User/Error.aspx  ~/Views/User/Error.ascx  ~/Views/Shared/Error.aspx  ~/Views/Shared/Error.ascx  ~/Views/User/Error.cshtml  ~/Views/User/Error.vbhtml  ~/Views/Shared/Error.cshtml  ~/Views/Shared/Error.vbhtml Stack Trace:   at System.Web.Mvc.ViewResult.FindView(ControllerContext context)     at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)     at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)     at System.Web.Mvc.Controller.ExecuteCore()     at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)     at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()     at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()     at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Anyone got an idea how I can solve this problem?
the following routes are mapped:

        // Error pages
        routes.MapRoute("Error404", "error/404", new { controller = "Error", action = "Error404" });
        routes.MapRoute("Error500", "error/500", new { controller = "Error", action = "Error500" });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:33:36+00:00Added an answer on May 27, 2026 at 5:33 pm

    I guess the MVC HandleError attribute is jumping in here, which is enabled by default for all actions by installing a global filter.

    You have not shown the <customErrors mode="?" part of your web.config. I guess its set to mode="remoteOnly", which would explain the behaviour you see.

    When running locally on your dev machine, the customErrors handling of ASP.NET is bypassed when setting customErrors mode="remoteOnly" and the <httpErrors element which is part of the IIS config (not ASP.NET) gets into action and displays the page corresponding to the http status code you configured.

    When running on a remote machine, ASP.NET error handling is active and the HandleError attribute is looking for the default error view which is called Error to display.

    If you don’t have a view called Error ASP.NET MVC raises an exception, that it is not able to find the configured error view.

    The simplest solution in your case is to remove the globally installed HandleError filter by removing the following line in global.asax.cs:

    filters.Add(new HandleErrorAttribute());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configured my default page to be say abcd.aspx and is under ~/View//abcd.aspx
I have configured WordPress to display a static front page as described here: http://codex.wordpress.org/Settings_Reading_SubPanel#Reading_Settings
I have configured a SMTP appender to send an email whenever there's an error.
I have custom errors configured in my web.config, but IIS 6.0 is returning the
We have an Elmah configured to send error notification emails to us whenever something
I have configured Tomcat to use LDAP / AD. How can I get more
I have configured Tomcat 6 to serve Perl CGI scripts. That part is well
I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if
I have configured java to dump garbage collection information into the logs ( verbose
I have configured my application to use form based authentication and set up the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.