Templates can be debugged in VisualStudio.
IncludeDebuggingInfo()
IRazorEngineCompiledTemplate template2 = razorEngine.Compile(templateText, builder => { builder.IncludeDebuggingInfo(); });
EnableDebugging()
template2.EnableDebugging(); // optional path to output directory string result = template2.Run(new { Title = "Welcome" });
Use @{ Breakpoint(); } code to stop at particular line
@{ Breakpoint(); }
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")
bin
EnableDebugging("MyTempPath")
There was an error while loading. Please reload this page.