I have a Custom Resolver which is applied to items of the type Publication, StructureGroup, Page and Component. The code runs as expected, but I am not clear on exactly when the code is called. My Tridion.ContentManager.config file contains the following extract:
<resolving>
<mappings>
<clear/>
<add itemType="Tridion.ContentManager.CommunicationManagement.Page">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PageResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
<add type="UrbanCherry.Net.SDLTridion.CustomResolvers.DynamicBinaryLinkResolver" assembly="UrbanCherry.Net.SDLTridion.CustomResolvers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e7729a00ff9574fb"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.CommunicationManagement.PageTemplate">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PageTemplateResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.ContentManagement.Component">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.ComponentResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
<add type="UrbanCherry.Net.SDLTridion.CustomResolvers.DynamicBinaryLinkResolver" assembly="UrbanCherry.Net.SDLTridion.CustomResolvers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e7729a00ff9574fb"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.CommunicationManagement.ComponentTemplate">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.ComponentTemplateResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.CommunicationManagement.Publication">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.PublicationResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
<add type="UrbanCherry.Net.SDLTridion.CustomResolvers.DynamicBinaryLinkResolver" assembly="UrbanCherry.Net.SDLTridion.CustomResolvers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e7729a00ff9574fb"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.CommunicationManagement.StructureGroup">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.StructureGroupResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
<add type="UrbanCherry.Net.SDLTridion.CustomResolvers.DynamicBinaryLinkResolver" assembly="UrbanCherry.Net.SDLTridion.CustomResolvers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e7729a00ff9574fb"/>
</resolvers>
</add>
<add itemType="Tridion.ContentManager.ContentManagement.Category">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.CategoryResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b"/>
</resolvers>
</add>
</mappings>
</resolving>
When I publish a Publication, StructureGroup or Page my Custom Resolver gets called once (which is what I had expected), however when I publish a Component (the Schema of which is linked to one Component Template which produces a Dynamic Component Presentation) the Custom Resolver is called twice.
Is this expected behavior? If not, can anyone suggest why my Resolver is called a second time?
The Resolver is called once for the Component, and once for each Component Template associated with the Component's Schema. Adding an additional CT for that Schema increased the number of calls to three.
It is not clear if this is a bug or by design, but explains the number of calls. Interesting the Custom Resolver is only called once when Un-Publishing the Component