Skip to main content
added 11 characters in body; edited title
Source Link
marc_s
  • 759.9k
  • 186
  • 1.4k
  • 1.5k

CustomError Mode off not showing detailed error message in ASP.NET MVC

On Localhostlocalhost I have Set Custom Errorset custom error mode off in web.configweb.config. There is no Application_ErrorApplication_Error method in global.asaxglobal.asax. I have also commented HandleErrorAttributeHandleErrorAttribute in Filter.configfilter.config, but still iI am not getting Detaildetailed error message / Yellowyellow screen of err / stacktrace onin my mvcASP.NET MVC app.

System.webSystem.web section in web.configweb.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> 

Having BelowI have this line of codeconfig in System.webserversystem.webserver:

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

But when I execute simple code belowshown here in Home Controller Index Actionthe HomeController's Index action method, it is goingredirecting to the /Home/Error Page/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();  } 

CustomError Mode off not showing detailed error message MVC

On Localhost I have Set Custom Error mode off in web.config. There is no Application_Error in global.asax. I have also commented HandleErrorAttribute in Filter.config but still i am not getting Detail error message / Yellow screen of err / stacktrace on my mvc app

System.web 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> 

Having Below line of code in System.webserver

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

But when I execute simple code below in Home Controller Index Action it is going to /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();  } 

CustomError Mode off not showing detailed error message in ASP.NET MVC

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(); } 
Source Link
Heemanshu Bhalla
  • 3.8k
  • 1
  • 31
  • 57

CustomError Mode off not showing detailed error message MVC

On Localhost I have Set Custom Error mode off in web.config. There is no Application_Error in global.asax. I have also commented HandleErrorAttribute in Filter.config but still i am not getting Detail error message / Yellow screen of err / stacktrace on my mvc app

System.web 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> 

Having Below line of code in System.webserver

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

But when I execute simple code below in Home Controller Index Action it is going to /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(); }