CodeSmith Generator templates are plain text files that contain three different types of content:

The dynamic content in a CodeSmith Generator template can be written in C#, Visual Basic, or JScript. For this template, we'll use C# as the template scripting language. We can set the scripting language (C#, Visual Basic, JScript) in the CodeTemplate directive's language attribute as shown in the code sample below). For this template you can use the Generator Template Editor or notepad.

You can create a new template in the  Generator Template Editor by selecting File -> New -> CSharp Template

Every CodeSmith Generator template starts with a CodeTemplate directive. This directive tells CodeSmith Generator some basic facts about the template. Here's the CodeTemplate directive for this template:

<%@ CodeTemplate Language="C#" TargetLanguage="C#" Description="Create an AssemblyInfo.cs file." %>

The CodeTemplate directive sample above defines three attributes (Language, TargetLanguage and Description).

With this single line of code saved as a file named AssemblyInfo.cst, you've got a CodeSmith Generator template. But it doesn't do anything yet.

Next: Start with the Result