Why is a full path to layout required in viewstart file when locations are specified in the view engine?
问题 I am playing with the razor view engine and there's something I don't quite get. The _ViewStart file specifies a layout with the full file path like this: @{ Layout = "~/Views/Shared/_MasterLayout.cshtml"; } As I understand it, the full path and extension must be included. You can't just do this: @{ Layout = "_MasterLayout"; } However the view engine specifies locations to search for the master views: MasterLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml"