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 5994077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:46:01+00:00 2026-05-22T23:46:01+00:00

In my ASP.NET MVC2 application Elmah fails to log any HttpRequestValidationException (except when you

  • 0

In my ASP.NET MVC2 application Elmah fails to log any HttpRequestValidationException (except when you are logged into the webserver via remote desktop and browsing the site as localhost)

For example if I type &#39 into a textbox when browsing normally from my pc using the domain name I get

Server Error in '/' Application.
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 remotely (for security reasons). It could, however, 
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on 
remote machines, please create a <customErrors> tag within a "web.config" 
configuration file located in the root directory of the current web application. 
This <customErrors> tag should then have its "mode" attribute set to "Off".

And nothing shows in the Elmah log.

But if I log into the webserver via remote desktop and browse the site as localhost I can see the full error message:

Server Error in '/' Application.
A potentially dangerous Request.Form value was detected from the client 

I know why different error messages are shown, it is because I don’t have a <customErrors mode="Off"/> node in my web.config. But that’s ok, I do not want the full error message shown to the whole world.

But what I do want is for Elmah to log this error when it occurs. What do I need to do to get this to work as expected?

  • 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-22T23:46:02+00:00Added an answer on May 22, 2026 at 11:46 pm

    I think this is this Elmah defect http://code.google.com/p/elmah/issues/detail?id=217 , which is caused by a breaking change in request validation in ASP.NET 4. The defect lists two possible workarounds (manually log the exception in ELMAH by catching it in the Application_Error handler or turning off the new validation behavior in the Web.config)

    See this blog post providing a workaround.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to use ELMAH on my ASP.NET MVC2 application, it works fine on
I have an asp.net mvc2 application that is using StructureMap 2.6 and NHibernate 3.x.
I'm using xval to use client side validation in my asp.net mvc2 web-application. Despite
ASP .NET MVC2 application controller performs some action and redirects to grid page after
I'm building ASP.NET MVC2 application, and using Entity Framework as ORM. I am having
I have an ASP.net MVC2 application. In wich I'm using JQuery to alter all
How to determine whether asp.net (mvc2) application is running under IIS (7) or VS
I have an asp.net MVC2 application that needs to call a web service from
I have a an ASP.NET MVC2 application, with Linq2SQL, that updates a database without
I have a ASP.NET MVC2 application with a master page. The master page renders

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.