It looks like I come across a bug on Tridion API's, while working on DotNet Templating using Tridion 2011 SP1.
ICollection<PublishInfo> publishInfos = PublishEngine.GetPublishInfo(mIdentifiableObject);
While executing GetPublishInfo
for Component Template, method returns ICollection
of PublishInfo
Objects.
Here PublishInfo
has properties like
- Publicaton
- PublicationTarget
- PublishedAt
- PublishedBy
- RenderedWith
Here, RenderedWith
returns of type Template
.
When we execute GetPublishInfo
for Component Template
, RenderedWith
property will have Component
as value (which is correct).
But unfortunately, RenderedWith
supports only of type Template
.
Due to this, we get error as
Unable to cast object of type 'Tridion.ContentManager.ContentManagement.Component' to type 'Tridion.ContentManager.CommunicationManagement.Template'
Now my question is,
Is anyone come across with this problem. If so, how you fixed?