After some days of crunching and debugging, I found the culprit(s). Here they are in random order:
-
If any of the following lines are present in the .csproj file, the views may or may not work (no consistent behaviour)
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
<MvcRazorCompileOnBuild>false</MvcRazorCompileOnBuild>
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish> -
If a view is set on the request with a name containing a ‘/’, the view will not work. I used this because I wanted to use views in specific folders.
Request.Items["View"] = "Pages/Advertisement/AdvertisementDetailsMessage";
This is a change from the 2.X version (probably Net Core itself) but may be worth putting in the Release Notes.