首页 > TAG信息列表 > razorengine

RazorEngine

模版引擎RazorEngine简介  这个只是替换模板里的指定字符串。 ASP.NET MVC的Razor想必大家都比较熟悉,这里介绍一个独立于ASP.NET的RazorEngine。 RazorEngine是一个开源的项目,它的基础就是ASP.NET MVC的Razor。GitHub项目地址。 您可以在Windows Console或者Windows Forms使用

C#-AspNetCore v2.0-在另一个项目中渲染剃刀视图以进行集成测试

我想为我的Web应用程序编写集成测试.我使用Microsoft.AspNetCore.TestHost.TestServer通过url与控制器进行通信.但是视图无法呈现.作为回应,我收到错误消息: One or more compilation references are missing. Ensure that your project is referencing ‘Microsoft.NET.Sdk.We

渲染视图到字符串:ArgumentOutOfRangeException

我有一个asp.net核心应用程序,并且有一个名为ViewRenderService的服务,该服务将视图转换为字符串,以便我根据发出的请求呈现某些视图. ViewRenderService: public class ViewRenderService : IViewRenderService { private readonly IRazorViewEngine _razorViewEngine

c# – 如何使用RazorEngine中的相同键在更新的模板上运行Complie?

string template = "Hello @Model.Name, welcome to RazorEngine!"; var result = Engine.Razor.RunCompile(template, "templateKey", null, new { Name = "World" }); 现在我将现有模板更新为如下所示.我从数据库中获取模板. string template = "Hello @Model.N

c# – RazorEngine 3.7.7 – 编译缓存模板时出错

我试图找出我们最近使用RazorEngine 3.7.5及更高版本的问题(试过3.7.7) 例外: System.ArgumentException: Please either set a template manager to templates or add the template ‘MySolution.Billing.Templates.Layout.cshtml’! 尝试使用Engine.Razor.Compile方法缓存模板