I have a self-hosting instance and I'm looking at adding some Razor + Markdown pages to it.
Could you clarify the best practice when rendering Content Pages (as defined in this very helpful SO answer) within a self-hosted service?
I can serve *.cshtml/ *.md content pages using the following methods:
- Setting Build Action to "Copy if Newer" (as per SO comment), or
- Setting Build Action to "Embedded Resource", or
WebHostPhysicalPath = Path.GetFullPath(Path.Combine("~".MapProjectPath())) when setting up
I'm wondering if there's a general best practice around this, or if there's some drawbacks to certain approaches?
Well each option pretty much explains what each approach does, personally for self-host I like to use embedded resources as it will let you ILMerge with other .dlls to create a single self-encapsulated .exe which you can also do with ServiceStack.Gap which does the additional benefit of pre-compiling the razor views.