HTTP Error 500.19 and error code : 0x80070021

  1. Go to server manager, click add roles and features.
  2. In the roles section choose Web Server.
  3. Under Security sub-section choose everything. (I excluded digest, IP restrictions and URL authorization as we don't use them)
  4. Under Application Development choose .NET Extensibility 4.5, ASP.NET 4.5 and both ISAPI entries.
  5. In the features section choose NET 3.5, .NET 4.5 and ASP.NET 4.5.