I have some html pages that I keep in a separate project which I specify to copy to output. This project is referenced by the main SS app.
When debugging following code inside a service call
var context = new TemplateContext
{
VirtualFiles = base.VirtualFiles,
}.Init();
var page = context.GetPage("emails/verify-email");
I get a page at path was not found error, looking at the virtualfiles properties it looks like it is only picking up html files from the project directory and not the bin\Debug\netcoreapp2.0\ which i expected when debugging.
Are there other additional properties I need to set in order for it to pick up html files from the bin\debug\netcoreapp2.0 directory?
What is the best way to get this to work in development?
I’m currently having to duplicate the html templates between projects for it to only work in dev, is there a workaround for to get dev to pick up the folder as it would when published?
It should be in the Host project folder along with all the other Website assets. This is the default location .NET Core expects your content resources to be in.
You could register it as an embedded resource or file system mapping, but the natural location is in your Content folder.