RazorGenerator icon indicating copy to clipboard operation
RazorGenerator copied to clipboard

Relative Partial Paths

Open traceygibbons opened this issue 6 years ago • 2 comments

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 avatar May 28 '19 16:05 traceygibbons

@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)

daiplusplus avatar Aug 26 '19 04:08 daiplusplus

@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)

traceygibbons avatar Aug 27 '19 09:08 traceygibbons