https://puresourcecode.com/net7/a-system-web-webpages-razor-configuration-hostsection-cannot-be-cast-to-web-config-issue/
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to… web.config issue