Cogito.Web.Razor
4.0.0
dotnet add package Cogito.Web.Razor --version 4.0.0
NuGet\Install-Package Cogito.Web.Razor -Version 4.0.0
<PackageReference Include="Cogito.Web.Razor" Version="4.0.0" />
<PackageVersion Include="Cogito.Web.Razor" Version="4.0.0" />
<PackageReference Include="Cogito.Web.Razor" />
paket add Cogito.Web.Razor --version 4.0.0
#r "nuget: Cogito.Web.Razor, 4.0.0"
#:package Cogito.Web.Razor@4.0.0
#addin nuget:?package=Cogito.Web.Razor&version=4.0.0
#tool nuget:?package=Cogito.Web.Razor&version=4.0.0
Cogito.Web.Razor
Compile and run Razor templates outside ASP.NET.
Why
The Razor parser is useful well beyond MVC — generating email bodies, reports, or code — but hosting
it yourself means dealing with RazorEngineHost, code generation and compilation by hand. This wraps
that into a template you can build and execute.
Install
dotnet add package Cogito.Web.Razor
Use
var template = new RazorTemplateBuilder()
.Build("Hello, @Model.Name.");
var text = template.Run(new { Name = "World" });
RazorHost is the configured engine host, IRazorTemplate the compiled result. Compilation and
parse failures surface as CompilerErrorException and ParserErrorException rather than as an
error collection you have to inspect.
Targets .NET Framework.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Cogito.Core (>= 4.0.0)
- Cogito.Irony (>= 4.0.0)
- Irony (>= 1.5.3)
- Microsoft.AspNet.Razor (>= 3.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cogito.Web.Razor:
| Package | Downloads |
|---|---|
|
Cogito.Web.UI.Razor
Provides objects to use Razor for WebForms |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 115 | 10/15/2026 |
| 3.1.37 | 126 | 9/14/2026 |
| 3.1.36 | 946 | 11/30/2020 |
| 3.1.35 | 697 | 11/16/2020 |
| 3.1.34 | 772 | 11/16/2020 |
| 3.1.30 | 862 | 11/15/2020 |
| 3.1.29 | 817 | 11/11/2020 |
| 3.1.27 | 719 | 11/11/2020 |
| 3.1.26 | 744 | 11/11/2020 |
| 3.1.24 | 759 | 11/11/2020 |
| 3.1.23 | 960 | 11/11/2020 |
| 3.1.20 | 907 | 11/11/2020 |
| 3.1.18 | 799 | 8/7/2020 |
| 3.1.16 | 818 | 8/7/2020 |
| 3.1.13 | 1,002 | 2/25/2020 |
| 3.1.10 | 864 | 2/25/2020 |
| 3.1.8 | 850 | 2/25/2020 |
| 3.1.7 | 905 | 2/25/2020 |
| 3.1.6 | 893 | 2/25/2020 |
| 3.0.11 | 826 | 2/7/2020 |