Kentico CMS 7.0 Context Help

Virtual objects

Virtual objects

Previous topic Next topic Mail us feedback on this topic!  

Virtual objects

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The Virtual objects tab allows you to store virtual objects in the file system in addition to the system's database.




You can use this section to prepare your website for deployment or for running in a Medium trust environment on .NET 3.5.


Click Store all virtual objects in file system to save all objects that require compilation (Form layouts, Page layouts, Page template layouts, Transformations and Web part layouts) to the disk. The target folder is ~/CMSVirtualFiles.

Click Store all virtual objects in database to move the virtual objects back into the system's database (deletes the files on the disk).


When deployment mode is OFF

The storage location of the virtual objects depends on the settings of the Source control options.


When deployment mode is ON

All objects that require compilation are moved into the file system on the local disk. The target folder is ~/CMSVirtualFiles.

You can configure the Source control options for objects that do not require compilation (Web part containers and CSS stylesheets).


Source control


The source control options allow you to store virtual objects in the file system, where you can edit the code in external editors, or manage objects using a source control system. The target folder is ~/CMSVirtualFiles.


Select which objects you want to store in the file system:



Requires compilation

Page layouts

Yes (for ASCX layouts)

Page template layouts

Yes (for ASCX layouts)


Yes (for ASCX transformations)

Web part layouts


Web part containers


CSS stylesheets



To store objects in the file system, check the boxes next to the required object types and click Apply changes.

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.


When using source control, you can still edit the code of objects through the Kentico CMS user 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.


Using deployment mode/source control on web application projects


When you enable deployment mode or source control on web application installations, the system cannot automatically integrate the created files into the Visual Studio project. You need to manually perform the following steps:


1.Edit your 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.(For Deployment mode only) Right-click the CMSVirtualFiles\WebPartLayouts folder and select Convert to Web Application.

5.Build the CMSApp project.


The code files are now integrated in your web application project, and you can edit them in Visual Studio inside the CMSVirtualFiles folder.


Additional resources


Developer's Guide -> Development -> Team development -> Deployment and source control

Developer's Guide -> Installation and deployment -> Visual Studio integration -> Precompilation (Publish function)