Application structure


Describes conventions for Sitecore Host applications.

Sitecore Host applications follow simple file and directory conventions. These conventions enable users to identify which files belong to the application (that the user should not modify directly) and which files are provided for the user (that the user can modify). The conventions also make it clear which files are used in different environments (for example, Production, Staging, and Development).

Root folder

The root folder defines the basic folder structure for a Sitecore Host application:

SitecoreHostApplication (Root)
├── *.dll
├── sitecorehost.xml
└── sitecorehost.<env>.xml
  • All code libraries (*.dlls) are at the root of the application.

  • (Optional) Next to the libraries is the sitecorehost.xml configuration file. This file controls configuration for Sitecore Host itself (not the application which runs on top of it).

  • (Optional) One or more environment-specific configuration files (for example, sitecorehost.production.xml or sitecorehost.development.xml) can be present. These files add to or override settings in sitecorehost.xml with configuration used when the application is run in the mode for that environment.

Additional folders and files that are specific to the .NET run-time environment can also be present. They are not shown here for the sake of keeping the diagram simple.

Application assets

A Sitecore Host application can provide other core assets such as configuration files, content, MVC views, or other physical files. When added to the application these folders are also be available under the root folder:

SitecoreHostApplication (Root)
├── content/
│   ├── js/
│   │   └── *.js
│   └── style/
│       └── *.css
├── config/
│   ├── config.xml
│   └── <env>
└── views/
    └── home/

The folders contain the following application assets:

  • content - Any physical files that the application can serve.

  • config - Any configuration files the application needs.

  • views - Any MVC views the application uses.

  • (Optional) - Any other folders the application developer has added.

Configuration environment folders

Sitecore loads configuration files in the config folder by name and in ascending alphabetic order. If Sitecore finds a folder with the same name as the current environment, it uses configuration files in this folder to patch the configuration files in the root of the config folder.

The Sitecore folder

A Sitecore Host application can reference one or more plugin libraries. Plugin libraries are added to the root of the application next to other dependent libraries. Additional assets provided by the plugin library are in the sitecorefolder in the root of the application:

SitecoreHostApplication (Root)
└── sitecore/
    ├── Plugin.Alpha/
    │   ├── sitecore.plugin.manifest
    │   ├── content/
    │   └── config/
    │       └── <env>
    └── Plugin.Beta/
        ├── sitecore.plugin.manifest
        ├── content/
        └── config/
            └── <env>

Plugins have the following characteristics:

  • Each plugin has a unique folder.

  • Each plugin folder always contains at least the sitecore.plugin.manifest file. 

  • All other folders under the plugin folder are optional and mirror the functionality of the Sitecore Host assets model.

The SitecoreRuntime folder

The SitecoreRuntime folder is a special folder that a consumer of a Sitecore Host application uses to extend or modify the application.

Each immediate child folder in this folder represents a specific runtime environment (Production, Development, and so on):

SitecoreHostApplication (Root)
└── sitecoreruntime/
    └── <env>/
        ├── *.dll
        ├── sitecorehost.xml
        ├── content/
        ├── config/
        └── sitecore/
            └── Plugin.B/
                ├── sitecore.plugin.manifest
                ├── content/
                └── config/
                    └── <env>

The SitecoreRuntime folder has the following characteristics:

  • Each folder acts as a store for an environment.

  • The base structure mimics that of the main Host application.

  • Sitecore loads the libraries in the folder at runtime.

  • the optional core content to patch and override other optional content.

  • If the folder contains a sitecorehost.xml file, Sitecore patches this after the sitecorehost.* files in the root of the host application, and ignores other sitecorehost.* files in the runtime folder.

  • Environment folders do not support their own SitecoreRuntime folders.

The SitecoreRuntime folder is also where you place your Sitecore license file to enable your Sitecore Host application to run.