Getting this log error repeatedly on a 7,10.4 site. Any ideas what might be causing it?
ERROR Umbraco.Core.Dynamics.DynamicInstanceHelper - An error occurred finding and executing extension method "IsDescendantOrSelf" for type "Umbraco.Web.Models.DynamicPublishedContent". Types searched for extension methods were Umbraco.Web.Models.DynamicPublishedContent.
System.MissingMethodException: Method 'Umbraco.Web.Models.DynamicPublishedContent.IsDescendantOrSelf' not found.
at Umbraco.Core.Dynamics.DynamicInstanceHelper.FindAndExecuteExtensionMethod[T](IRuntimeCacheProvider runtimeCache, T thisObject, Object[] args, String name, IEnumerable`1 findMethodsOnTypes)
Hey Alex, the issue is there are dynamics being used in various places and the error log doesn't say which partial is throwing the error so I'm not sure where to begin with debugging.
There's lots of it. Here's an example to switch a partial based on the parent page. We have to do this for various reasons on this particular site. Is there a better way?
Constant log error for IsDescendantOrSelf
Getting this log error repeatedly on a 7,10.4 site. Any ideas what might be causing it?
ERROR Umbraco.Core.Dynamics.DynamicInstanceHelper - An error occurred finding and executing extension method "IsDescendantOrSelf" for type "Umbraco.Web.Models.DynamicPublishedContent". Types searched for extension methods were Umbraco.Web.Models.DynamicPublishedContent. System.MissingMethodException: Method 'Umbraco.Web.Models.DynamicPublishedContent.IsDescendantOrSelf' not found. at Umbraco.Core.Dynamics.DynamicInstanceHelper.FindAndExecuteExtensionMethod[T](IRuntimeCacheProvider runtimeCache, T thisObject, Object[] args, String name, IEnumerable`1 findMethodsOnTypes)
Hi Amir
The problem is that you are calling extension methods on a dynamic. Please, find the place where it's used and rewrite it to strongly typed.
Thanks,
Alex
Hi Amir,
Can you share the code? and maybe you have some questions?
Alex
Hey Alex, the issue is there are dynamics being used in various places and the error log doesn't say which partial is throwing the error so I'm not sure where to begin with debugging.
Can you use Visual Studio? Just do a search over the code for "IsDescendantOrSelf" method.
There's lots of it. Here's an example to switch a partial based on the parent page. We have to do this for various reasons on this particular site. Is there a better way?
You need to replace all places with this code:
Thank you!!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.