使用 .config 和 patch 属性将自定义类添加到管道
我希望
<processor type="Estate.Packages.ModificationDate.SetModificationDate, Estate.Packages" />
下面的
web.config 中 这一行。 我尝试通过在网站的 app_config/include 文件夹中添加 .config 文件来实现此目的。
<configuration http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpRequestBegin>
<processor x:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="Sitecore.Packages.ModificationDate.SetModificationDate, Sitecore.Packages" />
</httpRequestBegin>
</pipelines>
</sitecore>
</configuration>
然而,这不起作用。如果我在 ExecuteRequest 管道下方的 web.config 中添加该行,则一切正常。当我使用 .config 文件时,没有任何反应。 (也没有错误信息) 有人知道我做错了什么吗?
I want this line
<processor type="Estate.Packages.ModificationDate.SetModificationDate, Estate.Packages" />
beneath
<processor type="Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel" />
in the web.config.
I tried to do this by adding a .config file in the app_config/include folder for the website.
<configuration http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpRequestBegin>
<processor x:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="Sitecore.Packages.ModificationDate.SetModificationDate, Sitecore.Packages" />
</httpRequestBegin>
</pipelines>
</sitecore>
</configuration>
However, this ain't working. If I add the line in the web.config beneath the ExecuteRequest pipeline everything is working correctly. When I use the .config file nothing happens. (No error message either)
Anybody got a clue of what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您查看显示配置工具(浏览到 http://yoursite/sitecore/admin/ showconfig.aspx)。它显示了最终合并的 Sitecore 配置,包括所有可插入配置。至少,它会告诉您注射是否在正确的位置以及是否以正确的方式进行。稍后您可以使用
x:after
属性的值来找出问题所在。据我所知,您提到您希望将处理器放在
ExecuteRequest
下,但您的代码引用了ItemResolver
...I suggest you to have a look at the Show Config tool (browse to http://yoursite/sitecore/admin/showconfig.aspx). It shows the final merged Sitecore configuration including all the pluggable configs out there. At least, it will give you a clue whether your injection is in the right place and in the right format. Later on you can play with the value of
x:after
attribute to find out what's wrong there.From what I see, you mention you'd like to place your processor under
ExecuteRequest
, but your code referencesItemResolver
instead...