Generate code from your template
Your template is ready to use.
- Save
AssemblyInfo.cst. - Double-click the file in File Explorer. CodeSmith Generator opens the template's property sheet.
- Enter values for the template's properties.
- Click Generate.
Generator builds a new AssemblyInfo.cs file instantly and shows it in the output window, where you can save or copy it.
What you've learned
This was a simple "Hello World" template. How much time it saves depends on how many new projects you create. But the same technique works for a wide range of code:
- Start with the output you want to build.
- Identify the static content.
- Make the calculated content dynamic.
- Add properties for the content the user supplies.
You can use it to build web services, data access layers, standard user interfaces and anything else you can imagine. Generator replaces repetitive hand-coding with code generation.
Next steps
- Learn more about declaring and using properties.
- Continue with Writing a template with database metadata.