1

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.

  • You cannot try anything before learning what is a lock and what is lock violation, https://learn.microsoft.com/en-us/iis/get-started/planning-for-security/how-to-use-locking-in-iis-configuration – Lex Li Jan 03 '20 at 15:04
  • As far as I know, the reason is most probably a locked attribute for the httpErrors section. You can check and unlock it in IIS Manager. Select your site (IIS site) and open Configuration Editor and from the Section dropdown list, select system.webServer/httpErrors.If there is a lock icon next to the defaultPath attribute or other attribute, right-click on the attribute name, select ‘defaultPath’ attribute from the context menu and choose Unlock Attribute action from submenu. – Brando Zhang Jan 06 '20 at 07:23

1 Answers1

1

After two weeks, finally I solve this problem:

simply clear tag and copy these tags:

  <remove statusCode="403"/>
  <remove statusCode="404"/>
  <remove statusCode="500"/>
  • My post here may also give some tips https://stackoverflow.com/questions/65649759/how-to-solve-mvc-5-update-and-delete-error/65767228#65767228 – Hannington Mambo Jan 18 '21 at 00:03