When you call the IsVisibleOnSite-extension method of the PageData-class and the PageData-instance is a shortcut to an ImageFile(ImageData), an InvalidCastException is thrown.
So the IsVisibleOnSite-method is checking the target of the shortcut and assuming it is also of type PageData(?).
Exception message: Unable to cast object of type 'Castle.Proxies.ImageFileProxy' to type 'EPiServer.Core.PageData'.
Is this expected behaviour or a bug?
EPiServer version is 11.3.0
We might just discover it at one pet dog shop in the higher Seattle location medium.com/ keeps in mind that dish could consist of greater focus of healthy protein.
We have this problem as well. If the shortcut points to a media file the same exception occurs. I believe it is the following code which throws the exception in the IsVisibleOnSite method:
if (pageData.TryGetShortcut(instance, out shortcut))
pageData = (PageData) shortcut;