You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project I'm currently working on has the .cshtml templates as embedded resources, so I'm trying to use them from the assembly.
My approach is to configure the MvcRazorRuntimeCompilationOptions as stated on the documentation, but using an EmbeddedFileProvider instead of a PhysicalFileProvider.
The template in this example exists in the assembly at xxxx.EmailSender.Templates.en-Default.cshtml
Services setup:
When trying to find and render the template:
I tried with different route configurations, but none of them worked. Seems like the viewEngine appends a '/' automatically, assuming it's a physical path. I'm not that knowledgeable regarding Razor Templating, is this something approachable or is it just a limitation of the viewEngine that is tied to the expected MVC-style routing?
Thank you for your help!
The text was updated successfully, but these errors were encountered:
Great! For the time being I'm using a workaround, including the files both as physical and embedded in the .csproj. Which is not really ideal but works for now.
The project I'm currently working on has the
.cshtml
templates as embedded resources, so I'm trying to use them from the assembly.My approach is to configure the
MvcRazorRuntimeCompilationOptions
as stated on the documentation, but using an EmbeddedFileProvider instead of a PhysicalFileProvider.The template in this example exists in the assembly at xxxx.EmailSender.Templates.en-Default.cshtml
Services setup:
When trying to find and render the template:
I tried with different route configurations, but none of them worked. Seems like the viewEngine appends a '/' automatically, assuming it's a physical path. I'm not that knowledgeable regarding Razor Templating, is this something approachable or is it just a limitation of the viewEngine that is tied to the expected MVC-style routing?
Thank you for your help!
The text was updated successfully, but these errors were encountered: