This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS
Same issue on Server 2016, IIS 10, 500.19 error. I installed the redirect module and it worked. I do not know why this was not included by default.
https://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads
To be clear it looks like the web.config from IIS 7 will work, or is designed to work, but the lack of this module gives the really odd and unhelpful error. Googling takes you to a Microsoft page which insists that your site is corrupted or your web.config is corrupted. Neither seems to be the case.
That unhelpful page is here: https://support.microsoft.com/en-us/kb/942055
My IIS 7.5 does not understand tag in web.config In VS 2010 it is underline that tag also. Check your config file accurate to find all underlined tags. I put it in the comment and error goes away.
I had exact same error message with IIS10 and Windows 10. I tried everything listed here (and other internet pages as well) but it did not fixed it. What solved the issue was to install .NET Core Hosting a second time (I choose "Repair" button).
I'm 100% confident this is what fixed it because I had to deploy the same website to other laptops as well (different brands but all Windows 10). The same error message (500.19) occurred and reinstalling bundle fixed it again.
Similar to the top answer, we were getting this incredibly unhelpful exception because of a missing IIS CORS module. It was the exact same error with Error Code (0x8007000d) and Config Source (-1: 0:), but installing the URL Rewriting module didn't fix it.
We had recently updated the web.config to enable CORS for some developers that needed it, but did not expect it would be required for all developers to install the IIS CORS module. Unfortunately it looks like it is required.
To fix it, install the IIS CORS module from here.
In my case, there was something wrong with the .NET Core Windows Hosting Bundle installation.
I had that installed and had restarted IIS using ("net stop was /y" and "net start w3svc") after installation, but I would get that 500.19 error with Error Code 0x8007000d and Config Source -1: 0:.
I managed to resolve the issue by repairing the .NET Core Windows Hosting Bundle installation and restarting IIS using the commands I mentioned above.
Hope this helps someone!
For me, re-registering asp.net for iis did the trick. Hopefully that helps someone else.
aspnet_regiis.exe -i