Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug 500.0 / 0x00000000 error on System.Web.Mvc.MvcHandler

I'm getting this strange error which I am unable to figure out. Running on Windows 8.1, IIS 8.5. The site runs fine on Microsoft Azure so it must be a local configuration issue. I get the same errors in IIS Express as I do with IIS.

The problem has been around for a few days and it's driving me mental. I can't even test simple CSS/Content changes (which is what I am trying to do) without pushing them up to Azure each time to check.

ERROR:

Module          global.asax
Notification    EndRequest
Handler         System.Web.Mvc.MvcHandler
Error Code      0x00000000
Requested URL   https://localhost:443/
Physical Path   C:\inetpub\wwwroot\dev\
Logon Method    Anonymous
Logon User      Anonymous
Request Tracing Directory C:\inetpub\logs\FailedReqLogFiles

Here is the trace for the section just before the warning.

THINGS I'VE TRIED

  • Reinstall IIS, .NET 4.5, Visual Studio
  • Checked permissions: IIS_IUSRS has access to the folder and files
  • Installed a basic MVC 5 demo app. Runs perfectly under the website & app-pool in question.
  • Put a basic aspx hello world page in the root of my website directory. It loads when in the Default web site, but when under the website in question I get a "PageHandlerFactory-Integrated-4.0" error.
like image 310
Carl Avatar asked Apr 06 '14 10:04

Carl


3 Answers

I was struggling with this same error message and I couldn't get any tracing or logging to happen. After days of research I realized it was an unhandled exception in Global.asax.cs. I would recommend auditing your Global.asax code to see if there is any opportunity for exceptions to happen.

Regardless, you might want to follow the best practice to handle such Application-level errors to output the last error message to a custom page:

http://msdn.microsoft.com/en-us/library/vstudio/24395wz3(v=vs.100).aspx

like image 60
zemien Avatar answered Oct 19 '22 06:10

zemien


  • comment out all you code inside Global.asax.cs Application_Error method

like image 2
Omu Avatar answered Oct 19 '22 05:10

Omu


I found the detailed error on Event Viewer -> Windows Logs -> Application

Turns out my AppPool user didn't had access to the database

like image 1
ariel Avatar answered Oct 19 '22 07:10

ariel