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
I cannot find any reference for this scenario in your Documentation.
My website name Project.Web compiles to Project.Web.dll and Project.Web.Views.dll.
I have got a standard folder structure and in Views I have got:
~/Views/Email/Alert.cshtml.
This Views folder is automatically compiled to Project.Web.Views.dll.
How can I reference it correctly through UsingTemplateFromEmbedded as the assembly actually doesn't exist at the time of development and the compiled view is not in Project.Web.dll which I could easily reference?
I guess you should use the Default Namespace from the project properties and then add the path the to cshtml: Root.Sample.Project.Templates.MyTemplate.cshtml
@lukencode@bjcull
Guys could you please describe a best way practice for using the Embedded views? Let's say we have a library (EmailService) with all the Templates which is shared across the several ASP.NET Core 2.1 projects in the solutions. We should change the Build action of the templates to Embedded resource by adding something like
As is it will cause the runtime error like Cannot find compilation library location for package 'Microsoft.NETCore.App' after publishing.
So we have to go to the published ASP.NET Core 2.1 application csproj file and add the line:
Which causes the publishing of the refs folder (which is pretty big) for the Razor for Embedded and not precompiled views.
Is it a best way? Maybe we shoule precompile Templates instead (since embedded resource doesn't allow to change the template like text file on the fly and requires DLL publishing for updating)?
Hi,
I cannot find any reference for this scenario in your Documentation.
My website name Project.Web compiles to Project.Web.dll and Project.Web.Views.dll.
I have got a standard folder structure and in Views I have got:
~/Views/Email/Alert.cshtml.
This Views folder is automatically compiled to Project.Web.Views.dll.
How can I reference it correctly through UsingTemplateFromEmbedded as the assembly actually doesn't exist at the time of development and the compiled view is not in Project.Web.dll which I could easily reference?
Hope that my question makes a sense? :)
Thanks.
The text was updated successfully, but these errors were encountered: