RazorGenerator
RazorGenerator copied to clipboard
Relative Partial Paths
Are relative partial paths supported by RazorGenerator.Mvc?
e.g. @Html.Partial("../Headings/Large", model)
Where we have these, partial views cannot be found at runtime. All class files appear to be generated without issue. We're using RazorGenerator.MsBuild to compile.
@traceygibbons They should work, but the base-path that relative-paths are applied to varies and I don't believe it's based on the physical filesystem structure of your RazorGenerator project, but it's been a long time since I last looked and I need to dig-up how it's calculated.
Have you found a solution or workaround since you posted your question that you can share? (and my apologies for taking so long to respond)
@traceygibbons They should work, but the base-path that relative-paths are applied to varies and I don't believe it's based on the physical filesystem structure of your RazorGenerator project, but it's been a long time since I last looked and I need to dig-up how it's calculated.
Have you found a solution or workaround since you posted your question that you can share? (and my apologies for taking so long to respond)
Hi @Jehoel, thanks for your reply. I'm afraid we could not find a workaround, we instead had to change our views to include the full path, e.g @Html.Partial("~/Views/Headings/Large.cshtml", model)