diff --git a/FluentEmail.sln b/FluentEmail.sln index e24d791c..a897462d 100644 --- a/FluentEmail.sln +++ b/FluentEmail.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26403.7 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29519.181 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6DC215BD-05EF-49A6-ADBE-8AE399952EEC}" EndProject @@ -48,9 +48,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.Mailtrap.Tests" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.Mailtrap", "src\Senders\FluentEmail.Mailtrap\FluentEmail.Mailtrap.csproj", "{FD858CCC-4CF3-4899-B72F-F93C13832174}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentEmail.MailKit", "src\Senders\FluentEmail.MailKit\FluentEmail.MailKit.csproj", "{AEC98399-8C63-4362-B307-0DFB25FFC948}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.MailKit", "src\Senders\FluentEmail.MailKit\FluentEmail.MailKit.csproj", "{AEC98399-8C63-4362-B307-0DFB25FFC948}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentEmail.MailKit.Tests", "test\FluentEmail.MailKit.Tests\FluentEmail.MailKit.Tests.csproj", "{57718ED0-6B5D-419F-A5C5-1884BE3529A5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.MailKit.Tests", "test\FluentEmail.MailKit.Tests\FluentEmail.MailKit.Tests.csproj", "{57718ED0-6B5D-419F-A5C5-1884BE3529A5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FullFramework", "sample\FullFramework\FullFramework.csproj", "{BFD8889F-CF38-4359-9173-FD42FDDD6648}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -118,6 +120,10 @@ Global {57718ED0-6B5D-419F-A5C5-1884BE3529A5}.Debug|Any CPU.Build.0 = Debug|Any CPU {57718ED0-6B5D-419F-A5C5-1884BE3529A5}.Release|Any CPU.ActiveCfg = Release|Any CPU {57718ED0-6B5D-419F-A5C5-1884BE3529A5}.Release|Any CPU.Build.0 = Release|Any CPU + {BFD8889F-CF38-4359-9173-FD42FDDD6648}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BFD8889F-CF38-4359-9173-FD42FDDD6648}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BFD8889F-CF38-4359-9173-FD42FDDD6648}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BFD8889F-CF38-4359-9173-FD42FDDD6648}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -142,6 +148,7 @@ Global {FD858CCC-4CF3-4899-B72F-F93C13832174} = {926C0980-31D9-4449-903F-3C756044C28A} {AEC98399-8C63-4362-B307-0DFB25FFC948} = {926C0980-31D9-4449-903F-3C756044C28A} {57718ED0-6B5D-419F-A5C5-1884BE3529A5} = {4DADBE55-BD91-4D14-92EA-1BD0D1545145} + {BFD8889F-CF38-4359-9173-FD42FDDD6648} = {361467ED-E13F-45C7-8182-21A62D5F7B47} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {23736554-5288-4B30-9710-B4D9880BCF0B} diff --git a/sample/FullFramework/App.config b/sample/FullFramework/App.config new file mode 100644 index 00000000..3b64b39f --- /dev/null +++ b/sample/FullFramework/App.config @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/FullFramework/EmailTemplates/Test1.cshtml b/sample/FullFramework/EmailTemplates/Test1.cshtml new file mode 100644 index 00000000..e5863407 --- /dev/null +++ b/sample/FullFramework/EmailTemplates/Test1.cshtml @@ -0,0 +1,15 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@model dynamic +@{ +} + + + + + +

A great email template

+

Hi there @Model.Name, It's great to see you!

+ + \ No newline at end of file diff --git a/sample/FullFramework/FullFramework.csproj b/sample/FullFramework/FullFramework.csproj new file mode 100644 index 00000000..7de3c21c --- /dev/null +++ b/sample/FullFramework/FullFramework.csproj @@ -0,0 +1,349 @@ + + + + + + Debug + AnyCPU + {BFD8889F-CF38-4359-9173-FD42FDDD6648} + Exe + FullFramework + FullFramework + v4.7.2 + 512 + true + true + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Microsoft.AspNetCore.Hosting.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll + + + ..\..\packages\Microsoft.AspNetCore.Hosting.Server.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll + + + ..\..\packages\Microsoft.AspNetCore.Html.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Html.Abstractions.dll + + + ..\..\packages\Microsoft.AspNetCore.Http.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Abstractions.dll + + + ..\..\packages\Microsoft.AspNetCore.Http.Features.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Features.dll + + + ..\..\packages\Microsoft.AspNetCore.Mvc.Razor.Extensions.2.1.0\lib\net46\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll + + + ..\..\packages\Microsoft.AspNetCore.Razor.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Razor.dll + + + ..\..\packages\Microsoft.AspNetCore.Razor.Language.2.1.0\lib\net46\Microsoft.AspNetCore.Razor.Language.dll + + + ..\..\packages\Microsoft.AspNetCore.Razor.Runtime.2.1.0\lib\netstandard2.0\Microsoft.AspNetCore.Razor.Runtime.dll + + + ..\..\packages\Microsoft.CodeAnalysis.Common.2.8.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll + + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.2.8.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll + + + ..\..\packages\Microsoft.CodeAnalysis.Razor.2.1.0\lib\net46\Microsoft.CodeAnalysis.Razor.dll + + + ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll + + + ..\..\packages\Microsoft.Extensions.Caching.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Caching.Memory.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll + + + ..\..\packages\Microsoft.Extensions.FileProviders.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.FileProviders.Physical.2.1.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll + + + ..\..\packages\Microsoft.Extensions.FileSystemGlobbing.2.1.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll + + + ..\..\packages\Microsoft.Extensions.Hosting.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Hosting.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Options.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll + + + ..\..\packages\Microsoft.Extensions.Primitives.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\RazorLight.2.0.0-beta4\lib\netstandard2.0\RazorLight.dll + + + + ..\..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll + True + True + + + ..\..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + + + ..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + + + + ..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + True + True + + + + ..\..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll + True + True + + + ..\..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll + True + True + + + ..\..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True + + + ..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + ..\..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll + True + True + + + ..\..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll + True + True + + + ..\..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll + + + + ..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll + + + ..\..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll + True + True + + + ..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + + + ..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll + True + True + + + ..\..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll + True + True + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\..\packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll + + + ..\..\packages\System.Text.Encodings.Web.4.5.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + ..\..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll + True + True + + + ..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll + True + True + + + + + + + + + ..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + ..\..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll + True + True + + + ..\..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll + True + True + + + ..\..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll + True + True + + + + + + + + + + + + + + {386B8AB1-E99A-4E08-83BE-DD1B8C2EE876} + FluentEmail.Core + + + {1c444ddd-1e09-4edb-a6a1-57ba29c54f73} + FluentEmail.Razor + + + {3808d62f-9f8a-4644-a965-361968770cfb} + FluentEmail.Smtp + + + + + + + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/sample/FullFramework/Program.cs b/sample/FullFramework/Program.cs new file mode 100644 index 00000000..592864b2 --- /dev/null +++ b/sample/FullFramework/Program.cs @@ -0,0 +1,35 @@ +using FluentEmail.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mail; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using FluentEmail.Razor; +using FluentEmail.Smtp; + +namespace FullFramework +{ + public class Program + { + static async Task Main(string[] args) + { + Email.DefaultSender = new SmtpSender(new SmtpClient("localhost", 25)); + Email.DefaultRenderer = new RazorRenderer(); + + var model = new + { + Name = "Ben" + }; + + var assembly = Assembly.GetAssembly(typeof(FullFramework.Program)); + + await Email.From("fullframework@test.test") + .To("test3@test.test") + .Subject("console full framework") + .UsingTemplateFromEmbedded("FullFramework.EmailTemplates.Test1.cshtml", model, assembly) + .SendAsync(); + } + } +} diff --git a/sample/FullFramework/Properties/AssemblyInfo.cs b/sample/FullFramework/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..21c0ec98 --- /dev/null +++ b/sample/FullFramework/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FullFramework")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FullFramework")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bfd8889f-cf38-4359-9173-fd42fddd6648")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/sample/FullFramework/packages.config b/sample/FullFramework/packages.config new file mode 100644 index 00000000..e0c94a68 --- /dev/null +++ b/sample/FullFramework/packages.config @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/SampleWeb/Controllers/HomeController.cs b/sample/SampleWeb/Controllers/HomeController.cs index 7d6e3434..107a6635 100644 --- a/sample/SampleWeb/Controllers/HomeController.cs +++ b/sample/SampleWeb/Controllers/HomeController.cs @@ -1,5 +1,9 @@ -using System.Threading.Tasks; +using System.Net.Mail; +using System.Reflection; +using System.Threading.Tasks; using FluentEmail.Core; +using FluentEmail.Razor; +using FluentEmail.Smtp; using Microsoft.AspNetCore.Mvc; namespace SampleWeb.Controllers @@ -45,10 +49,31 @@ await emailFactory.Create() .To("test1@test.test") .SetFrom("sender2@test.test") .Subject("test email subject") - .UsingTemplate(@"hi @Model.Name this is the second email @(5 + 5)!", model1) + .UsingTemplate(@"hi @Model.Name this is the second email @(5 + 5)!", model2) .SendAsync(); return Content("ok"); } + + public async Task NonDependencyInjectionTest() + { + Email.DefaultSender = new SmtpSender(new SmtpClient("localhost", 25)); + Email.DefaultRenderer = new RazorRenderer(); + + var model = new + { + Name = "Ben" + }; + + var assembly = Assembly.GetAssembly(typeof(SampleWeb.Program)); + + await Email.From("nondependencyinjection@test.test") + .To("test2@test.test") + .Subject("old way") + .UsingTemplateFromEmbedded("SampleWeb.EmailTemplates.Test1.cshtml", model, assembly) + .SendAsync(); + + return Ok(); + } } } diff --git a/sample/SampleWeb/EmailTemplates/Test1.cshtml b/sample/SampleWeb/EmailTemplates/Test1.cshtml new file mode 100644 index 00000000..e5863407 --- /dev/null +++ b/sample/SampleWeb/EmailTemplates/Test1.cshtml @@ -0,0 +1,15 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@model dynamic +@{ +} + + + + + +

A great email template

+

Hi there @Model.Name, It's great to see you!

+ + \ No newline at end of file diff --git a/sample/SampleWeb/SampleWeb.csproj b/sample/SampleWeb/SampleWeb.csproj index 6de5cdd1..f7f5ccc1 100644 --- a/sample/SampleWeb/SampleWeb.csproj +++ b/sample/SampleWeb/SampleWeb.csproj @@ -1,15 +1,28 @@ - + - netcoreapp2.2 + netcoreapp3.1 + + + true + true + - + + + + + - + + + + + diff --git a/sample/SampleWeb/Startup.cs b/sample/SampleWeb/Startup.cs index b1569aa1..9e0f0a4f 100644 --- a/sample/SampleWeb/Startup.cs +++ b/sample/SampleWeb/Startup.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace SampleWeb { @@ -17,7 +18,7 @@ public Startup(IConfiguration configuration) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(); + services.AddControllersWithViews(); services .AddFluentEmail("defaultemail@test.test") @@ -26,25 +27,29 @@ public void ConfigureServices(IServiceCollection services) } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { - app.UseBrowserLink(); app.UseDeveloperExceptionPage(); + app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); } - + app.UseHttpsRedirection(); app.UseStaticFiles(); - app.UseMvc(routes => + app.UseRouting(); + + app.UseEndpoints(endpoints => { - routes.MapRoute( + endpoints.MapControllerRoute( name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); + pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } diff --git a/src/Renderers/FluentEmail.Razor/FluentEmail.Razor.csproj b/src/Renderers/FluentEmail.Razor/FluentEmail.Razor.csproj index 12ba5aac..bfb6bc19 100644 --- a/src/Renderers/FluentEmail.Razor/FluentEmail.Razor.csproj +++ b/src/Renderers/FluentEmail.Razor/FluentEmail.Razor.csproj @@ -11,14 +11,14 @@ https://github.com/lukencode/FluentEmail https://github.com/lukencode/FluentEmail netstandard2.0 - 2.7.0 - 2.7.0.0 - 2.7.0.0 + 2.8.0 + 2.8.0.0 + 2.8.0.0 - + diff --git a/src/Renderers/FluentEmail.Razor/RazorRenderer.cs b/src/Renderers/FluentEmail.Razor/RazorRenderer.cs index 99e06f14..9b58a585 100644 --- a/src/Renderers/FluentEmail.Razor/RazorRenderer.cs +++ b/src/Renderers/FluentEmail.Razor/RazorRenderer.cs @@ -16,6 +16,7 @@ public class RazorRenderer : ITemplateRenderer public RazorRenderer() { _engine = new RazorLightEngineBuilder() + .UseEmbeddedResourcesProject(typeof(RazorRenderer)) .UseMemoryCachingProvider() .Build(); } @@ -23,7 +24,7 @@ public RazorRenderer() public RazorRenderer(string root) { _engine = new RazorLightEngineBuilder() - .UseFilesystemProject(root ?? Directory.GetCurrentDirectory()) + .UseFileSystemProject(root ?? Directory.GetCurrentDirectory()) .UseMemoryCachingProvider() .Build(); } @@ -47,7 +48,7 @@ public RazorRenderer(Type embeddedResRootType) public async Task ParseAsync(string template, T model, bool isHtml = true) { dynamic viewBag = (model as IViewBagModel)?.ViewBag; - return await _engine.CompileRenderAsync(GetHashString(template), template, model, viewBag); + return await _engine.CompileRenderStringAsync(GetHashString(template), template, model, viewBag); } string ITemplateRenderer.Parse(string template, T model, bool isHtml)