Versions Compared

Key

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

We strive to ensure that CodeSmith Generator templates are 100% backwards compatible. However, in very rare circumstances we break backwards compatibility to progress the platform. When we do break backwards compatibility, we ensure that the benefits of breaking compatibility greatly outway the benefits of not breaking compatibility. Please refer to this document when upgrading CodeSmith Generator to ensure that you have the smoothest experience possible.

...

Info

CodeSmith Generator is compiled against version 4.6.0 2 of the .NET Framework. This means that all code that consumes the Generator API needs to be targeting .NET 4.6.0 or 2 or newer. This does not mean that the template you write has to generate .NET 4.0 code (CodeSmith Generator can generate any text based content...)! This just means that your CodeSmith Generator class libraries need to be compiled as .NET 4.6.02.

  1. Locate your templates source code folder or source project and open the Visual Studio solution. The source code for our Template Frameworks can be found in the templates \Source\ directory.
  2. Update all Visual Studio projects that reference CodeSmith.Engine to .NET 4.6.02
  3. Update all of the Visual Studio project's assembly references in your Solution that reference CodeSmith Generator assemblies. Below is a set of steps that will help guide you through this process.
    1. Open Solution Explorer.
    2. Right click on your Project in Solution Explorer and select Add Reference.
    3. The Add References dialog will contain all CodeSmith Generator references. If you do not see the reference in the list, then they can be be found in the Generator Program Files folder.
    4. Select the reference and click the OK button.
  4. Add a project reference to CodeSmith.Core to all Visual Studio projects that reference CodeSmith assemblies. This assembly is located in the CodeSmith Generator Program Files bin folder.
  5. Rebuild your Solution. 

    Warning

    If you are updating an existing Template Framework Solution. Please ensure that each projects compiled assemblies are being copied to the correct folder after build (E.G., from the \ProjectName\bin\debug folder to the templates \common\ folder).


  6. Regenerate your existing Generator Project Files

...

In Generator 6.0, we introduced a new API's to compile templates using TemplateEngine. In Generator 6.5, we made some major improvements to the TemplateEngine, DefaultEngineHost and IEngineHost interface. These changes allowed us to support new features in memory content. It also allowed feature development without breaking the API. The section below covers any breaking changes that were made during these updates.

...

Generator 6.0Current ImplementationAction To TakeDescription
string GetFileContent(string)string GetContent(string, bool)Rename Method Overloads and add Boolean parameterThe name was changed to represent generic content and not specifically file content. 

bool ContentExists(string)Implement MethodImplement method if you are inheriting the IEngineHost interface or wish to override the default behavior.

 RegisteredContent RegisteredContentImplement PropertyImplement property if you are inheriting the IEngineHost interface.

...

Generator 6.0Current ImplementationAction To TakeDescription
DefaultEngineHost(string)DefaultEngineHost(string)Validate BasePathThe constructor will now throw an ArgumentException if the passed in base path doesn't exist.
RegisterInMemoryContent(string, string) 
Method has been removed.See the example below for more information on registering content.

...

It is recommended to update your existing CodeTemplateCompiler implementation to use TemplateEngine, but this is not required. Please see the SDK documentation for more information.

SchemaExplorer Type Converter changes

...