Hi,
I am currently follwing post: https://world.episerver.com/documentation/developer-guides/find/personalized-find/
I have added in the appropriate app settings for episerver:personalization.Site and episerver:personalization.ClientToken and have added
UsingPersonalization() extension method to the search query. Up this point the site runs fine.
However when I add the Controller Attribute:
[EPiServer.Find.Personalization.RefreshPreferences]
or use the below code to refresh the personalization:
System.Threading.Tasks.Task.Factory.StartNew(currentContext => { System.Web.HttpContext.Current = (HttpContext)currentContext; _client.Personalization().Refresh(); }, System.Web.HttpContext.Current.ApplicationInstance.Context);
my site won't wont run at all and gives the following object reference error:
[NullReferenceException: Object reference not set to an instance of an object.] EPiServer.Find.Personalization.ClientExtensions.Personalization(IClient client) +22 EPiServer.Find.Personalization.RefreshPreferencesAttribute..ctor() +43 System.RuntimeTypeHandle.CreateCaInstance(RuntimeType type, IRuntimeMethodInfo ctor) +0 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1476 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +160
Any help as to why this would be greatly appreciated!
Regards,
Martin