2

So we know that Sitecore.Configuration.Factory reads through all files ending in *.config in the App_Config/Include folder of your website root.

But I've seen with SXA and JSS, that additional config files are placed in these directories.

enter image description here

Are these picked up by as any other config files as well? or does SXA and JSS respectively "hook into" Sitecore's configuration mechanics to read these?

5

These are not Sitecore patch config files, and as such they are not read by the Sitecore Configuration Factory, so nothing has changed in that regard with only .config files being loaded.

If you inspect the contents of the config files using Notepad, you'll notice they are all changes that should be applied to the web.config file. For example, in Sitecore.JavaScriptServices.MediaRequestHandler.jssconfig:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <system.webServer>
    <handlers>
      <add verb="*" path="sitecorejss_media.ashx" type="Sitecore.JavaScriptServices.Media.MediaRequestHandler, Sitecore.JavaScriptServices.Media" name="Sitecore.JavaScriptServices.Media.MediaRequestHandler" />
    </handlers>
  </system.webServer>
</configuration>

This is not patching a <sitecore> section of the config, it's targeting an element in the root web.config. This is automatically applied by a post-install step when you install the JSS and SXA packages respectively:

  • Sitecore.JavaScriptServices.Install.PostInstall, Sitecore.JavaScriptServices.Install
  • Sitecore.XA.Foundation.Installer.ExperienceAcceleratorInstallationPostStep, Sitecore.XA.Foundation.Installer

In each of these post-install steps there is a method which checks for all .jssconfig and .sxaconfig files within the /App_Config folder and applies the required changes to the web.config. Once you have installed the packages, you should check the web.config to ensure that the relevant changes have been applied.

NOTE: If you have checked in the stock web.config into your source code, then you should ensure that these changes have also been applied. Unlike some earlier modules, the fact that these web.config changes are required is not mentioned in any of the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.