Sitecore TDS : Ways to Stop Code Generation for Models

In Sitecore TDS (Team Development for Sitecore), code generation is a crucial feature that automatically generates code files based on the Sitecore items in your TDS project. These generated code files provide strongly-typed access to Sitecore items and their fields, making it easier to work with Sitecore data in your Visual Studio projects.

Sometimes there is a need to disable TDS code generation and that can be through following ways.

In TDS Projects

Disable of code generation at the TDS project level and it has to be done for all the TDS projects.

  1. Open your Visual Studio solution that contains the Sitecore TDS project.
  2. In the Solution Explorer window, locate the Sitecore TDS project that you want to disable code generation for.
  3. Right-click on the project and select "Properties" from the context menu.
  4. In the project properties window, navigate to the "TDS Options" tab.
  5. Under the "Code Generation" section, you will find various options related to code generation.
  6. To disable code generation, uncheck the "Enable Code Generation" checkbox.
  7. Optionally, you can also adjust other code generation settings according to your requirements.
  8. Click "OK" to save the changes.

By disabling code generation, the Sitecore TDS project will no longer generate code files based on the TDS project items during the build process.

Visual Studio Project Properties


In Visual Studio

There is an option to disable the code generation for TDS projects in Visual Studio but that is only specific to each developer local instance.

In General, Code Generation is automatically triggered after every item change in the TDS Project tree. This could be inconvenient if the project contains many items.

If any one doesn't need Code Generation after every change, the feature can be disabled by navigate through Visual studio tools > Options > TDS Options > General and set these two fields to False as shown below.

  1. Autorun Code Generation 
  2. Run Code Generation for Changes

Visual Studio Tool TDS options


This feature is avaiable from all versions of TDS classic after 5.5 version.

Comments