File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ Install-Package RazorEngineCore
3838* [ Switch from RazorEngine cshtml templates] ( https://github.com/adoconnection/RazorEngineCore/wiki/Switch-from-RazorEngine-cshtml-templates )
3939* [ Azure Functions FileNotFoundException workaround] ( https://github.com/adoconnection/RazorEngineCore/wiki/Azure-Functions-FileNotFoundException-workaround )
4040* [ @Html implementation example] ( https://github.com/adoconnection/RazorEngineCore/wiki/@Html-implementation-example )
41+ * [ Debugging] ( https://github.com/adoconnection/RazorEngineCore/wiki/Debugging )
42+
4143
4244## Extensions
4345* [ wdcossey/RazorEngineCore.Extensions] ( https://github.com/wdcossey/RazorEngineCore.Extensions )
@@ -89,6 +91,23 @@ string result = template.Run(instance =>
8991Console .WriteLine (result );
9092```
9193
94+ #### Debugging
95+ Compile template with ``` IncludeDebuggingInfo() ``` option and call ``` EnableDebugging() ``` before running template
96+ If template was compiled with ``` IncludeDebuggingInfo() ``` option, saveing and loading will keep original template source code and pdb.
97+ ``` cs
98+ IRazorEngineCompiledTemplate template2 = razorEngine .Compile (templateText , builder =>
99+ {
100+ builder .IncludeDebuggingInfo ();
101+ });
102+
103+ template2 .EnableDebugging (); // optional path to output directory
104+
105+ string result = template2 .Run (new
106+ {
107+ Title = " Welcome"
108+ });
109+ ```
110+
92111#### Save / Load compiled templates
93112Most expensive task is to compile template, you should not compile template every time you need to run it
94113``` cs
You can’t perform that action at this time.
0 commit comments