I am trying to patch a file (already a patch) so that it can be loaded after that, but the patching is not working.
Below is the scenario:
- Create a patch config file for loading the DI configurator in the foundation layer
- Now trying to patch the DI configurator for a feature so that it loads after the foundation's patch file using the patch:after syntax.
- When I check the order in the showconfig.aspx then feature's patch is not loading after the foundation's config but it is loading before the foundation config as shown in the screenshot below.
FYI: below is the syntax that I have used for patching:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<services>
<configurator type="DDD.Feature.Documents.Pipelines.RegisterGenericTypes, DDD.Feature.Documents" patch:after="*[@type='BBB.Foundation.DependencyInjection.Infrastructure.MvcControllerServicesConfigurator,BBB.Foundation.DependencyInjection']"/>
</services>
</sitecore>
</configuration>
But if I do patch:before or patch:after for any sitecore type then it works. For example, in the screenshot you can see the top line like Sitecore.Services.Infrastructure.Sitecore.DependencyInjection.....
, if I will do path:after or patch:before for it then patching works.
I am not sure if patching an already patched file is allowable or not. If so then please let me know where am I making the gap in the config?
Even I checked the loadOrder it seems to be fine as following:
<layer name="Custom" includeFolder="/App_Config/Include/">
<loadOrder>
<add path="Rainbow.config" type="File" />
<add path="Unicorn" type="Folder" />
<add path="Foundation" type="Folder" />
<add path="Feature" type="Folder" />
<add path="Project" type="Folder" />
</loadOrder>
</layer>
zzz.Last
folder and check if the patching order is correct. It will let you know if it's an issue with the config or load order.