I have an Umbraco application which was developed from an Umbraco Visual Studio ASPNET Core (.NET6) project. It consumes Umbraco 10.4 and Usync 10.3.3 Nuget packages.
The site is empty, except for one DocumentType, "Home" and a single Home page created from it. The page has an additional hostname defined for the subdomain on which it is to be hosted. The page is published and displays as expected on localhost.
I publish the site and deploy it to a Windows VPS running Windows Server 2022, IIS 10, MS SQL Server Express 2019, and a spec which is adequate for Umbraco 10 (4 x 2.2GHz processors, 4GB RAM, plenty of disk space). The site is hosted on the subdomain defined for the page.
The Umbraco back office runs as expected, but when I navigate to the site home page, it shows a "Page Not Found" message. In the application log, I find the following warning:
2023-03-11T13:55:39.2339886+00:00 [WRN] (Umbraco.Cms.Web.Common.Controllers.RenderController)
No physical template file was found for template "Home"
The template "Home" does exist in the site and has been deployed correctly. The AppPool identity has full control of the entire site directory structure.
What is causing this page not to be shown?
Turned out that a couple of properties needed to be removed from the Visual Studio project file to prevent this error. See the section on "Production Mode" in this page:
https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/runtime-modes
The properties to remove are:
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>