Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The easiest way to build a CodeSmith Generator template is to start with an example of the code that you want to generate - in this case, a finished AssemblyInfo.cs file. Here's one that we'll use as we move through this tutorial:

...

Now that we know what we want to build, it's time to get the content into the template.

Info
Note: Although we're not using the capability in this example,

...

CodeSmith Generator templates can easily contain conditional logic. For example, you could prompt the user for a value for the AssemblyDelaySign attribute, and then include additional attributes in the template's output if they set that attribute to true.

Next: Static Content in the Template

...