emilol / razormailer Goto Github PK
View Code? Open in Web Editor NEWA standalone console app for parsing and sending email templates using the Razor SDK
A standalone console app for parsing and sending email templates using the Razor SDK
Hello,
I try using the code inside an Azure Function App. The Problem is, the RazorCompiledItemLoader do not find any Views/Templates if I include the library in an Azure Function project. If I include the same project into an console app, all works fine and the views are found/loaded and parsed. Both targets .netcoreapp2.2 (console app, function app). The only difference I see is that the console app has an output type of "exe" and the function app does not. Are there any limitations based on this setting?
csproj-File function app:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="Reporting.csproj" />
</ItemGroup>
</Project>
csproj-File console app:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="Reporting.csproj" />
</ItemGroup>
</Project>
Not sure if this is already possible, but how would you go about using layout pages with this?
I get this error when it is trying await razorPage.ExecuteAsync()
at Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.get_TagHelperFactory()
at Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.CreateTagHelper[TTagHelper]()
at AspNetCore.Email_Index.<ExecuteAsync>d__8.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MyProject.RazorEngine.<GetOutput>d__3`1.MoveNext()
I know this isn't much of a bug report, but this is pretty much all I have :p
It might be because I have dotnetcore 3.0 installed. Might something be different there?
Hi Emily
I tried to follow your guide, when I do a render I get this error
System.AggregateException: 'One or more errors occurred. (Unable to cast object of type 'AspNetCore.EmailTemplates_Company_WelcomeMail' to type 'Microsoft.AspNetCore.Mvc.Razor.RazorPage`1[System.Object]'.)'
Any idea on how to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.