A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/adoconnection/RazorEngineCore/wiki/Debugging below:

Debugging · adoconnection/RazorEngineCore Wiki · GitHub

Templates can be debugged in VisualStudio.

  1. Compile template with IncludeDebuggingInfo() option. It will produce and keep PDB and Template source code.
IRazorEngineCompiledTemplate template2 = razorEngine.Compile(templateText, builder =>
{
    builder.IncludeDebuggingInfo();
});
  1. Call EnableDebugging() before running template, it will write template source code to your active directory thus enabling VS to step into template.
template2.EnableDebugging(); // optional path to output directory

string result = template2.Run(new
{
    Title = "Welcome"
});
  1. Use @{ Breakpoint(); } code to stop at particular line

  2. when you run the code VS will ask you for cshtml file location

this will be either your bin folder or specific path specified in EnableDebugging("MyTempPath")


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4