---
title: Editing code externally and using source control systems
related:
  - https://docs.kentico.com/k82/deploying-websites/deployment-mode-for-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).

Kentico provides a way to store virtual objects 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 objects using a source control system.

To store objects 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/k82/configuring-kentico/creating-alternative-forms.md)                                       | Yes (for ASCX layouts)         |
| [Form layouts](https://docs.kentico.com/k82/managing-website-content/forms/defining-custom-form-layout.md)                                       | Yes (for ASCX layouts)         |
| [Page layouts](https://docs.kentico.com/k82/developing-websites/developing-websites-using-the-portal-engine/editing-page-layouts.md)             | Yes (for ASCX layouts)         |
| [Page template layouts](https://docs.kentico.com/k82/developing-websites/developing-websites-using-the-portal-engine/editing-page-layouts.md)    | Yes (for ASCX layouts)         |
| [Transformations](https://docs.kentico.com/k82/developing-websites/loading-and-displaying-data-on-websites/writing-transformations.md)           | Yes (for ASCX transformations) |
| [Web part layouts](https://docs.kentico.com/k82/custom-development/developing-web-parts/using-custom-web-part-layouts.md)                        | Yes                            |
| [CSS stylesheets](https://docs.kentico.com/k82/developing-websites/designing-websites-using-css.md)                                              | No                             |
| [Web part containers](https://docs.kentico.com/k82/developing-websites/developing-websites-using-the-portal-engine/using-web-part-containers.md) | No                             |

- To store objects 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 objects back into the database, uncheck 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/k82/editing-code-externally-and-using-source-control-systems/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/k82/deploying-websites/deployment-mode-for-virtual-objects.md) is **ON**, you cannot configure the source control options for objects that require compilation (only for Web part containers and CSS stylesheets).

When using source control, you can still edit the code of objects through the Kentico 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/k82/external-utilities/kentico-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/k82/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 Kentico UI 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.

## Using source control on web application projects

When you enable source control on _web application_ installations, the system cannot automatically integrate the created files into the Visual Studio project. If you wish to edit the code of objects directly within your web application project, 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. Build the **CMSApp** project.

You can now edit the code files of objects in Visual Studio inside the _CMSVirtualFiles_ folder. In source control mode, the system generates **ascx** files without code behind files, so you do not need to convert the files into the web application format.
