---
title: Enabling continuous integration for custom classes
related:
  - https://docs.kentico.com/13/custom-development/creating-custom-modules/setting-the-type-information-for-module-classes.md
  - https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration.md
  - https://docs.kentico.com/13/custom-development/creating-custom-modules/setting-the-type-information-for-module-classes/reference-objecttypeinfo.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The Xperience [continuous integration solution](https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration.md) allows you to serialize the data of objects from the database into XML files and then use a source control system to synchronize the files between different instances. To enable continuous integration for the data of custom module classes, you need to set the appropriate [type information](https://docs.kentico.com/13/custom-development/creating-custom-modules/setting-the-type-information-for-module-classes.md) when developing your classes. For more information about the basics of module and class development, see the example in [Creating custom modules](https://docs.kentico.com/13/custom-development/creating-custom-modules.md).

To configure continuous integration support for a custom module class:

1. Open the solution where you are developing the custom module (in Visual Studio).

2. Edit the _Info_ class representing your module class.

   > **Note:** **Important**: To use continuous integration, the code of your custom class must be located in a separate assembly. See the [Adding the class code into a separate assembly](#adding-the-class-code-into-a-separate-assembly) section for more information and instructions.

3. Set the **ContinuousIntegrationSettings** property in the [initializer](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers) of the TYPEINFO object. Use a nested initializer to configure the properties of the _ContinuousIntegrationSettings_ class:

   - Set the **Enabled** property to _true._
   - (Optional) Set the other [ContinuousIntegrationSettings properties](#continuousintegrationsettings) according to the requirements of your class's data.

   ```csharp

   // Enables continuous integration for the object type
   ContinuousIntegrationSettings =
   {
       Enabled = true
   },

   ```

4. (Optional) Set the **SerializationSettings** property of the TYPEINFO object. Use a nested initializer to configure the [SerializationSettings properties](#serializationsettings).

5. Save the changes.

If continuous integration is enabled, the system now tracks all create, update and delete operations for objects of the given custom class, and serializes the data into XML files in the _CIRepository_ folder.

To transfer all existing data of the class into your continuous integration repository, run complete serialization for all objects:

1. Disable running of [scheduled tasks](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md) (using the **Settings -> System -> Scheduled tasks enabled** setting).
2. Open the **Continuous integration** application in the Xperience administration interface.
3. Click **Serialize all objects**.
4. Wait until the serialization process finishes and then re-enable scheduled tasks.

You can also use your custom object type's name (the value of the _OBJECT\_TYPE_ constant) when filtering objects for continuous integration within the **repository.config** file. See [Excluding objects from continuous integration](https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration/excluding-objects-from-continuous-integration.md) to learn more.

## Adding the class code into a separate assembly

When [restoring data](https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration/restoring-continuous-integration-files-to-the-database.md) from the continuous integration repository to the database, the process runs outside of the Xperience web application (as a console application by default). Module classes defined directly within the Xperience administration project (_CMSApp_) cannot be detected by external utilities that are not web applications and are ignored by the continuous integration restore process.

To correctly use continuous integration with custom module classes, your class code files _(Info_, _IInfoProvider_ and _InfoProvider_ classes) must be defined within a **separate assembly**. The assembly must also be configured to allow the system to detect classes using the **AssemblyDiscoverable** assembly attribute.

If your module classes are located directly in the Xperience administration project, use the following process to move the code to a separate assembly:

> **Info:** **Modules with installation package support**
>
> The following steps describe how to create a standard code library (assembly) project for the module code.
>
> If you are developing a module that you plan to deploy using installation packages, create a _web application_ project for the module according to the steps in [Creating installation packages for modules](https://docs.kentico.com/13/custom-development/creating-custom-modules/creating-installation-packages-for-modules.md).

1. Create a new _Class Library_  project (assembly) in the solution  (or reuse an existing custom project).

2. Add the Xperience API libraries to the module project:
   1. Right-click the solution in the **Solution Explorer** and select **Manage NuGet Packages for Solution**.
   2. Select the **Kentico.Xperience.Libraries** package.
   3. Install the package into the project (the version must match your live site (MVC) project's _Kentico.Xperience.AspNet.Mvc5_ package and the exact hotfix version of your Xperience administration project).

3. Add a reference from the Xperience administration project (_CMSApp_) to the custom module project.

4. Edit the module project's **AssemblyInfo.cs** file (in the _Properties_ folder).

5. Add the **AssemblyDiscoverable** assembly attribute:

   ```csharp

   using CMS;

   [assembly:AssemblyDiscoverable]

   ```

6. Move all of the module's code files _(Info_, _IInfoProvider_ and _InfoProvider_ classes, etc.) into the new project.

7. Save all changes.

8. Rebuild the solution.

Placing the class code into a discoverable custom assembly allows the continuous integration solution to work with the class when restoring data from the _CIRepository_ folder.

## Deleting classes that have continuous integration enabled

Use the following process if you ever need to delete a custom class with existing data and continuous integration enabled:

1. First delete the given class's code files and rebuild the module project in Visual Studio (or remove the entire module project if it is no longer needed).
2. Delete the class in the **Modules** application in the Xperience administration interface.
3. Manually delete the folder representing the class's data from your _CIRepository_ folder (the system automatically removes the data from the database, but cannot clear the continuous integration data).

## References

> **Info:** The reference lists the **ContinuousIntegrationSettings** and **SerializationSettings** properties that are intended for public use. The classes also contain other members that are used internally or handled automatically by the system. We do not recommend working with any of the undocumented members.

### ContinuousIntegrationSettings

The **ContinuousIntegrationSettings** property of _ObjectTypeInfo_ determines how classes work with the [continuous integration](https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration.md) solution.

Assign an instance of the _ContinuousIntegrationSettings_ class and set its properties:

| Property             | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enabled              | bool        | Indicates whether the class is included in the system's continuous integration solution (when serializing all objects to the file system and tracking object changes).<br>Child classes are included only if the property is also enabled for the parent class.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| DependencyColumns    | ICollection | Defined as an _ICollection_ of field names. When the values of the specified fields are changed for an object, the continuous integration solution reserializes the given object and all of its child or otherwise dependent objects.<br>Only needs to be set for classes that use non-standard fields to determine the identity of objects. The object type's code name, GUID, parent ID, site ID and group ID fields are included by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ObjectFileNameFields | ICollection | Overrides the names of the XML files containing the serialized data of the class's objects within the _CIRepository_ folder. By default, the XML files are named according to the **CodeNameColumn** value of the corresponding object. For object types without a code name field, the **GuidColumn** value is used instead.<br>The property is defined as an _ICollection_ of field names that the system combines into the names of the continuous integration XML files. Underscores ( \_ ) are used as separators between the values of the specified fields.<br>**Note**: For continuous integration to work correctly, the combination of fields must be unique within the appropriate scope (within a given site for site-related objects, within the objects under a specific parent, etc.).                                                                                                                                                                                                        |
| ObjectTypeFolderName | string      | Sets the name of the folder that stores the XML files containing the serialized data of the class's objects within the _CIRepository_ folder.<br>If not specified, the object type name (value of the **ObjectType** type information property) is used by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| SeparatedFields      | IEnumerable | Identifies fields that the continuous integration solution stores into separate files when serializing objects to the file system. The separated file is created within the same folder as the main XML file holding the remaining serialized data of the object.<br>To define the separated fields, assign an _IEnumerable_ collection of **SeparatedField** objects into _SeparatedFields_. For each _SeparatedField_ object, specify the name of the field as the constructor parameter. You can configure additional settings for the separated file through the properties of the _SeparatedField_ object.<br>**Note**: If the class has a field that stores binary data (specified in the **BinaryColumn** type information property), the system includes the field in _SeparatedFields_ by default. Manually setting the _SeparatedFields_ property overrides the default separation settings for the _BinaryColumn_ field, but you can define a custom _SeparatedField_ object for the given field. |

```csharp title="Example"

ContinuousIntegrationSettings =
{
    Enabled = true,

    // Adds a field that the continuous integration solution serializes into a separate file (in addition to the BinaryColumn field)
    SeparatedFields = new List<SeparatedField>
    {
        new SeparatedField("SeparatedField")
        {
            FileName = "CustomFileName",
            FileExtension = ".txt"
        }
    }
}

```

### SerializationSettings

The **SerializationSettings** property of _ObjectTypeInfo_ determines how the system serializes class objects from the database into XML data. The serialization is used by the system's continuous integration solution.

Assign an instance of the _SerializationSettings_ class and set its properties:

| Property           | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ExcludedFieldNames | ICollection | Allows you to limit which fields are included when serializing objects of the given class to XML. Defined as an _ICollection_ of field names that you wish to exclude from the serialization (blacklist).<br>By default, the system automatically excludes the class's **IDColumn**, **TimeStampColumn**, **VersionGUIDColumn** and **BinaryColumn**.                                                                                                  |
| StructuredFields   | IEnumerable | Identifies fields that contain structured data, and cannot directly be serialized as inner text values of an XML element (for example fields with XML values). Ensures that the system correctly formats the value, for example as nested XML without a [CDATA section](http://en.wikipedia.org/wiki/CDATA).<br>To work with custom data formats, you need to create an **IStructuredField** implementation that defines how the serialization occurs. |

```csharp title="Example"

SerializationSettings =
{
    // Adds two fields to the default collection of fields that are excluded from the serialized data
    ExcludedFieldNames = { "ClassField", "ClassSecondField" },

    // Ensures that the system processes "ClassXmlField" as nested XML in the serialized data
    StructuredFields = new IStructuredField[]
    {
        new StructuredField("ClassXmlField")
    }
}

```
