You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the following line in your template source and your debugger(vs code/vs studio) break on it.
213
+
```cs
214
+
System.Diagnostics.Debugger.Break();
215
+
```
216
+
Use this overload for the Compile function and pass true for the addPdb argument
217
+
```cs
218
+
razorEngine.Compile(templateSource, builder=>
219
+
{
220
+
builder.AddAssemblyReferenceByName("System.Security"); // by name
221
+
builder.AddAssemblyReference(typeof(System.IO.File)); // by type
222
+
builder.AddAssemblyReference(Assembly.Load("source")); // by reference
223
+
},
224
+
true); //This 'true' will enable debugging.
225
+
```
226
+
Your debbuger will ask you to provide the path to the source file, by defult it is set to be generated in %temp% (point your there when asked for the file).
227
+
211
228
212
229
#### Credits
213
230
This package is inspired by [Simon Mourier SO post](https://stackoverflow.com/a/47756437/267736)
@@ -216,6 +233,8 @@ This package is inspired by [Simon Mourier SO post](https://stackoverflow.com/a/
216
233
#### Changelog
217
234
* 2022.8.1
218
235
* Proper namespace handling for nested types and types without namespace #113 (thanks [@Kirmiir](https://github.com/Kirmiir))
236
+
* 2022.7.6
237
+
* Added the option to genereate pdb alongside the assembly which allows debugging the templates.
0 commit comments