---
title: Editing object code externally
related:
  - https://docs.kentico.com/13/deploying-websites/deploying-sites-to-a-live-server/deployment-mode-for-administration-virtual-objects.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).

Xperience provides a way to store the code of objects used for administration interface development in the file system, in addition to the database. Having code files on a local disk allows you to edit code in external editors or manage it using a source control system.

> **Note:** **Note**: This feature only manages code. Other object data and settings remain only in the database and are _NOT_ represented in the file system. The [continuous integration solution](https://docs.kentico.com/13/developing-websites/setting-up-continuous-integration.md) provides a more complete solution if you wish to synchronize development objects using a source control system.

To store object code in the file system, open the **System** application and select the **Virtual objects** tab. The options in the **Source control** section allow you to select which objects are stored in the file system:

| Option                                                                                                                                                                                   | Requires compilation   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| [Alternative form layouts](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/creating-alternative-forms.md)                                          | Yes (for ASCX layouts) |
| Form layouts                                                                                                                                                                             | Yes (for ASCX layouts) |
| [Page layouts](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/developing-the-administration-using-portal-engine/editing-page-layouts.md)          | Yes (for ASCX layouts) |
| [Page template layouts](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/developing-the-administration-using-portal-engine/editing-page-layouts.md) | Yes (for ASCX layouts) |
| [Transformations](https://docs.kentico.com/13/macro-expressions/writing-transformations-for-macros.md)                                                                                   | No                     |
| [Web part layouts](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/developing-web-parts/using-custom-web-part-layouts.md)                          | Yes                    |

- To store object code in the file system, select the boxes next to the required object types and click **Apply changes**. The file are saved in the _\~/CMSVirtualFiles_ folder.
- To move object code back into the database, clear the corresponding boxes and click **Apply changes**. Checked objects stay in the file system and unchecked objects are moved back into the database.
- Click **Synchronize changes to database** to copy the code from the files on the disk into the matching objects in the database.

![Form layouts and Page layouts are stored on the disk and can be managed using a source control system](https://docs.kentico.com/docsassets/13/editing-object-code-externally/Source_Control.png "Form layouts and Page layouts are stored on the disk and can be managed using a source control system")

> **Info:** **Source control in Deployment mode**
>
> If [Deployment mode](https://docs.kentico.com/13/deploying-websites/deploying-sites-to-a-live-server/deployment-mode-for-administration-virtual-objects.md) is **ON**, you cannot configure the source control options for objects that require compilation.

When using source control mode, you can still edit the code of objects through the Xperience administration interface. If you edit an object, the system displays the code from the corresponding file. Saving the code in the UI writes the data into both the file system and the database.

> **Note:** **Limitations**
>
> - Do not [apply hotfixes](https://docs.kentico.com/13/external-utilities/kentico-xperience-hotfix-and-upgrade-utility/upgrading-and-hotfixing-an-instance.md) while using source control mode. Before you start the hotfix procedure, return files to the database. You can re-enable source control mode once the hotfix is applied.
> - The [Staging](https://docs.kentico.com/13/deploying-websites/content-staging.md) feature has limited support for synchronizing object code when using source control mode:
>   - On _source_ servers, staging tasks are generated only if you edit code in the Xperience administration interface or after you synchronize changes from files into the database.
>   - On _target_ servers, source control mode must be **disabled** if you wish to use incoming staging tasks to update object code.

## Editing files and deploying with source control enabled

When you enable source control, the system cannot automatically include the created files into your Visual Studio project. If you wish to edit the code of objects in Visual Studio or deploy the web application, perform the following steps:

1. Open the project in Visual Studio.
2. Click **Show all files** at the top of the Solution Explorer.
3. Right-click the **CMSVirtualFiles** folder and select **Include in Project**.
4. Rebuild the solution.

You can now edit the code files of objects in Visual Studio inside the _CMSVirtualFiles_ folder.
