Net 6 showing 500.19 error reading the wrong web.config

Viewed 532

I deployed a brand new site on IIS. It is in .Net 6. I am getting a 500.19 error that it cannot read the configuration file due to insufficient permissions.

\\?\D\Sites\SiteDirectory\wwwroot\web.config

The problem is this web.config file that it is pointing to is not the one for my website. It is looking for a web.config in the wwwroot directory for some reason. As a matter of fact there is no web.config that even exists at that location.

The correct web.config file exists in D:\Sites\SiteDirectory\wwwroot\SiteName\web.config

Why is IIS looking at wwwroot? How can I fix this behavior? My other .Net Framework 4.7 sites work fine without this web.config at the root directory.

1 Answers

I solved it by installing this component:

Windows Hosting Bundle

"https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-6.0.6-windows-hosting-bundle-installer"

Related