在Sitecore中修补web.config

在Sitecore中修补web.config,sitecore,config,patch,Sitecore,Config,Patch,我需要在sitecore的web.config中的cleanupagent部分添加一行。 我想补充以下几行: <remove folder="/App_Data/MediaCache" pattern="*.json" maxAge="01.00:00:00" recursive="true"> 下面是配置xml <sitecore> <agent type="Sitecore.Tasks.CleanupAgent"> <files h

我需要在sitecore的web.config中的cleanupagent部分添加一行。 我想补充以下几行:

<remove folder="/App_Data/MediaCache" pattern="*.json" maxAge="01.00:00:00" recursive="true">

下面是配置xml

<sitecore>
  <agent type="Sitecore.Tasks.CleanupAgent">
    <files hint="raw:AddCommand">
      <remove folder="/App_Data/MediaCache" pattern="*.json" maxAge="01.00:00:00" recursive="true" patch:after="files[@hint='raw:AddCommand']"/>
    </files>
  </agent> 
</sitecore>

您遇到的问题是,Sitecore正在匹配现有节点,即现有的
文件夹=“/App\u Data/MediaCache”
元素,并根据其节点匹配规则进行替换,而不是插入新的节点

为了防止匹配,您需要使节点更独特,最简单的方法是添加一个附加属性,例如
desc=“json”
(您也可以使用
name
hint
属性):



修补程序应该立即在配置中插入新元素,而不是替换。

本文的可能副本介绍了如何修改现有条目。在我的例子中,我需要在类似条目之前添加一个条目。有关于如何做到这一点的帖子,但它们不适合我。谢谢你的帮助。不用担心,我想可能是同一个问题。。。看来@jammykam已经掩护你了!