Before everyone reads this, I just want to say that i know that there are related threads out there, but I have either tried them or do not understand. With that being said here
In my case I had .Net core SDK 3.1.403 was installed. So I installed the corresponding .Net Core Windows Server Hosting which is .NET core 3.1.9 - Windows Server Hosting.
I had a sub folder named web.config renaming this folder resolved the issue
In the Edit Application Pool window, set the .NET CLR version to No Managed Code
On this msdn blog: Troubleshooting HTTP 500.19 Errors in IIS 7 in sceanrio 8 for error code 0x80070005 (E_ACCESSDENIED - General access denied error) it says:
Grant Read permission to the IIS_IUSRS group ...
.... the worker process identity (and/or the IIS_IUSRS group) needs at least Read access to the directory so that it can check for a web.config file in that directory.
I fixed this by restarting VS.
I had opened a config file in another instance of VS and apparently sth went nuts...
My issue is that I accidentally installed another site as the default site instead of the IIS default (by opening another project.) I had to remove the default site and repoint it to the default location C:\inetpub\wwwroot
using my domain login as the user to bypass with then just reopened my project that I was trying to run (the one showing this error) and it was all honky dorry