Closed liamkavfc closed 1 year ago
Fixed this issue!
var engine = new RazorLightEngineBuilder()
.UseEmbeddedResourcesProject(typeof(QueueTrigger).Assembly)
.SetOperatingAssembly(typeof(QueueTrigger).Assembly)
.UseMemoryCachingProvider()
.Build();
var rendered = await engine.CompileRenderAsync("EmailTemplates.ForgotPassword", messageDto);
Adding SetOperatingAssembly()
fixed it! 👍
Describe the bug I am running into the error that is mentioned in the title.
When I list my embedded files, the file in question is the only one in the list, but the error still remains.
System.Private.CoreLib: Exception while executing function: QueueTrigger. RazorLight: Project can not find template with key ForgotPassword.cshtml.
To Reproduce Steps to reproduce the behavior: Follow README.md steps 'Embedded Resource'
Expected behavior I would expect the error to not be there after following the README
Information (please complete the following information):
Additional context I am implementing this in an Azure function. I have read the README.md section on this and have jumped this hurdle, I feel like the key not found is the last step.