1

enter image description hereI want disable couple of config files using patch file or edit layer.config file.Have included below peace of lines of code to disable file.

I can disable specific config by adding .disable/example to config but i dont want to each and every config to disable. am looking for single patch config file to disable config.

<add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config" type="File" mode="Off" />
<add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config" type="File" mode="Off" />

Eventually above piece code not working , could some suggest how i can disable config files.

5
  • are the above lines wrapped in a <loadOrder> section? Commented May 31, 2022 at 5:47
  • <layer name="MarketingAssets" includeFolder="/App_Config/Sitecore/Marketing.Assets/"> <loadOrder> <add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config" type="File" mode="Off" /> <add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config" type="File" mode="Off" /> </loadOrder> </layer> Yes, its wrapped with load order.
    – Reddy
    Commented May 31, 2022 at 5:48
  • any chance it's case-sensitive? as in mode="off" instead of mode="Off"? Commented May 31, 2022 at 5:53
  • can you please tell what's your Sitecore version Commented May 31, 2022 at 5:53
  • Using 9.x only ...I tired with both mode="off" and mode="Off".. it didnt work out
    – Reddy
    Commented May 31, 2022 at 5:55

3 Answers 3

0

To disable a single patch file, you can do one of two things:

Option1: Navigate to the patch file in the file system, and rename it to end in something other than .config. For example, rename Sitecore.Analytics.Config to Sitecore.Analytics.Config.Disabled.

Option2: Add the patch file to a <loadOrder> section and add the mode="Off"` attribute. For example: <add path="Sitecore.Analytics.Config" type="File" mode="Off" />

Note: Option 2 will only work with 9.0 or later versions.

11
  • I am looking for second option but that is not working .Am able to hide folder level by adding mode="off" but its not working on config level.
    – Reddy
    Commented May 31, 2022 at 5:51
  • Yes .. am using Sitecore version 9.x only
    – Reddy
    Commented May 31, 2022 at 5:53
  • did you wrap it into <loadOrder> Commented May 31, 2022 at 5:55
  • yes. Wrapped with loadorder <layer name="MarketingAssets" includeFolder="/App_Config/Sitecore/Marketing.Assets/"> <loadOrder> <add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config" type="File" mode="Off" /> <add path="Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config" type="File" mode="Off" /> </loadOrder> </layer>
    – Reddy
    Commented May 31, 2022 at 5:56
  • i tried like this also in layer.config <?xml version="1.0" encoding="utf-8"?> <layers> <layer name="Sitecore" includeFolder="/App_Config/Sitecore/"> <loadOrder> <add path="FederatedExperienceManager/Sitecore.FXM.Solr.DomainsSearch.Index.Master.config" type="File" mode="off"/> </loadOrder> </layer> </layers> but none of things didnt workout
    – Reddy
    Commented May 31, 2022 at 5:59
0

What you need to do is to double-check the path and placement of your config into the Layers.config file. Look at the below example.

I need to disable a config file named training.config. And this is in the folder \App_Config\Include\zzz.

So I added the location and the path in the Layers.config file like this.

<layer name="Custom" includeFolder="/App_Config/Include/">
   <loadOrder>
      <add path="Foundation" type="Folder" />
      <add path="Feature" type="Folder" />
      <add path="Project" type="Folder" />
      <add path="/zzz/training.config" type="File" mode="off" />
   </loadOrder>

So you can see that I used the location under the include folder i.e. /App_Config/Include/ and then given the path of the file under the zzz folder like this /zzz/training.config

And this is working for me.

Please check and verify the path and the location where you are adding in the Layers.config and try again.

Also for your config that you have mentioned in your question, I have checked and it's working fine on my local and I have added the entry in the Layers.config file like this.

<loadOrder>
  <add path="/Marketing.Assets/Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config" type="File" mode="off" />
  <add path="/Marketing.Assets/Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config" type="File" mode="off" />

Adding the screenshot of Layers.Config.

enter image description here

Hope this will solve your issue.

Thanks

14
  • Thanks for you details explanation.. had tried same approach for me its was not workout
    – Reddy
    Commented May 31, 2022 at 7:38
  • @Reddy did you add /Marketing.Assets/ before your config in the path. As I have shared? Commented May 31, 2022 at 7:41
  • Yes ...Can u please share your screen shoot of your layer.config
    – Reddy
    Commented May 31, 2022 at 7:43
  • @Reddy I have updated my answer with screenshot. Commented May 31, 2022 at 7:49
  • Under which Layer you have included below above two patches... Layer means Sitecore or Module 0r custom?
    – Reddy
    Commented May 31, 2022 at 7:50
0

This feature won't support on Sitecore 9.x version and this feature will be supported on Sitecore 10.x version only. If you would like to use this feature please upgrade Sitecore 10.X.

I had raised a Sitecore support ticket and they confirmed this product bug on Sitecore 9.x version. For more information please find below the Sitecore support Ticket case number (CS0300419).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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