Viewing the compiled template source code
When you generate or compile a template, CodeSmith Generator turns it into source code and compiles that into an assembly. When you're tracking down a problem, it can help to see that source code.
In Visual Studio:
-
In Solution Explorer, right-click the template and click Properties.
-
Set the Custom Tool property to
TemplateSourceGenerator.
-
In Solution Explorer, a file ending in
.g.csor.g.vbnow appears under the template, as aDependentUponfile. For example, a C# template namedTemplate.cstgetsTemplate.g.cs. -
Open that file to view the compiled template source code.