I accepted teo answer. He helped me and made me understand the problem. But there are a few important things to check.
One thing that I did not know about was that the generated cshtml files have properties called PageVirtualPathAttribute . One problem, I could not get the right combination, because I misunderstood the way.
Another thing to look at is the class that is automatically created when RazorGenerator is installed and is located in the App_Start folder.
public static class RazorGeneratorMvcStart { public static void Start() { var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) { UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal }; ViewEngines.Engines.Insert(0, engine);
However, this line has an overload method to determine the path to your compiled view. My common project was created by someone else, and he introduced this path into it.
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly, @"~/Areas/Cart/", null)
Once I checked these bits, I just need to use, as shown below, in my view as suggested.
@Html.Partial("~/Areas/Cart/Views/Home/_GenericGreeting.cshtml")
source share