Errors after enabling the SwitchMasterToWeb.config file


Description

When enabling the SwitchMasterToWeb.config file for configuring the distributed Sitecore environment, you may face several issues:

The issue may occur when some config files in the /App_Config/Include folder are applied after the SwitchMasterToWeb.config file and revert the configuration changes made by the SwitchMasterToWeb.config file.

To learn more about how Sitecore uses include config files, refer to the Include File Patching Facilities document.

Solution

Ensure that the SwitchMasterToWeb.config file is applied as the latest one in the list of configuration changes.

For example, follow the steps below:

  1. Create a sub-directory in the /App_Config/Include folder that is the latest one alphabetically comparing to other sub-folders (e.g. Z_SwitchMasterToWeb).
  2. Move the SwitchMasterToWeb.config file to that folder.