CodeSmith Generator

CodeSmith Generator logo

CodeSmith Generator is a template-based source code generator. You write a template once, point it at your metadata (a database schema, an XML file, .NET types or values you type in) and Generator produces the code. It works with any text-based language: C#, Visual Basic, T-SQL, HTML, XML and more.

Generator runs inside Visual Studio, as the standalone Template Explorer, from the command line and from MSBuild, so you can generate code interactively or as part of every build.

Find your way around

Section What's in it
Getting started What Generator does, system requirements, installation, editions and activation.
Tutorials Step-by-step walkthroughs: generate code from a sample template, write your first template, and build a template that reads database metadata.
Using Generator The tools you work in: Visual Studio integration, Template Explorer, the Template Editor, Schema Explorer, the Map Editor, Generator projects, the console application and ActiveSnippets.
Writing templates Template syntax from the basics to advanced techniques, and how to drive templates with metadata such as database schema and XML.
Advanced topics Merge strategies, active generation, template caching, custom schema providers, CodeSmith.BaseTemplates and CodeSmith.CustomProperties.
Reference Frequently asked questions, tips, sample templates, Premier Support and license terms.
Generator API Run Generator from your own .NET code with the Generator SDK, and the API reference.

Getting started with Generator

  1. Check the system requirements and install Generator.
  2. Activate your license, or start a trial.
  3. Work through Generate code from a sample template to generate code in a few minutes.
  4. Write your first template.

More resources