asp.net-mvcwindows-server-2012-r2iis-8.5http-errorcustom-errors

HTTP Error 500.19 - Internal Server Error (Module: CustomErrorModule, Error Code: 0x80070021)


I'm programming ASP.Net MVC 5 in VS2015. My website runs with no error from visual studio but after publishing (IIS 8.5, Windows Server 2012), this error displays.

Of course, I would point out that this error is displayed for pages where errors like 403, 404, 500, etc. occur.

enter image description here

I tried many ways but I didn't get it. For example a change to Web.Config or adding a new Feature to IIS but none worked.


Solution

  • After two weeks, finally I solve this problem:

    simply clear tag and copy these tags:

      <remove statusCode="403"/>
      <remove statusCode="404"/>
      <remove statusCode="500"/>