HTTP Error 500.19 - Internal Server Error trying to setup a dev from production site

I’m fairly new to c# and umbraco but have ample MVC experience in other languages. I’ve been tasked to make some minor changes to an existing Umbraco 8 site and have given access to the current production site and database.

I have setup the application in IIS (10), imported the database, setup permissions for IIS_IUSRS but getting an annoying HTTP Error 500.19 which is not descriptive at all:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:
Module	   IIS Web Core
Notification	   Unknown
Handler	   Not yet determined
Error Code	   0x8007000d
Config Error	   
Config File	   \\?\D:\home\testsite\web.config
Requested URL	   http://localhost:8051/
Physical Path	   
Logon Method	   Not yet determined
Logon User	   Not yet determined

Config Source:
   -1: 
    0: 

More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
View more information »

If I remove all content from the web.config file, the the -1 dissapears, so it appears that this is not a permissions issue that IIS cannot read the files.

Further to this, if I run the application through Visual Studio debugger, it works (albeit it says I need to run the previous build) but it does atleast run the site completely.

The only changes I made was the database credentials in the web.config, but even with the base web.config there is no difference, and as the Config Source appears to be missing I have no idea how to debug this.

Any ideas?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/105329-http-error-50019-internal-server-error-trying-to-setup-a-dev-from-production-site