Try our conversational search powered by Generative AI!

Henrik Fransas
Jan 28, 2019
  2487
(3 votes)

Fixing error on loading critera for visitor group after changing namespace

Sometimes you need to move code and with that change the namespace for a class.

If you do it for a content type there should be no problem at all since Episerver will update it as long as you have specified a GUID for the content type, and that is something we always do, right.... ;-)

For some other part of the code it is a little bit harder since it will not be fixed by Episerver and one of these things is if you have created your own Visitor Group Criterion. The reason for that is that Episerver has saved information about the namespace in the database inside the BigTable.

There is a way to fix this and that Episerver have a SQL View that it use to talk to the database about Visitor Group Criterion that is named: "VisitorGroupCriterion" and we can use this ourself to fix the namespace.

So to fix this you need to write an SQL-statement that looks like this (You need to change the part OLDNAMESPACE, NEWNAMESPACE, OLDASSEMBLYNAME and NEWASSEMBLYNAME to your own info).

Update VW_VisitorGroupCriterion
Set TypeName = 'NEWNAMESPACE.CustomCriterion, NEWASSEMBLYNAME'
Where TypeName = 'OLDNAMESPACE.CustomCriterion, OLDASSEMBLYNAME'

After you have done this you need to recycle the application pool or in any other way make Episerver release all it´s cache and will need to update from the database again.

If you get an error saying that the database can not find VW_VisitorGroupCriterion it means that the criterion has not been used so it should not be any problem.

Disclaimer: You should not be updating information inside the Episerver Database if you do not know what you are doing. I give you this tip because it worked for me and if you do it, be sure to take a backup of the database first and run it with care!

Jan 28, 2019

Comments

Please login to comment.
Latest blogs
Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024

The Experimentation Process

This blog is part of the series -   Unlocking the Power of Experimentation: A Marketer's Insight. Welcome back, to another insightful journey into...

Holly Quilter | May 16, 2024

Azure AI Language – Sentiment Analysis in Optimizely CMS

In the following article, I showcase how sentiment analysis, which is part of the Azure AI Language service, can be used to detect the sentiment of...

Anil Patel | May 15, 2024 | Syndicated blog

Optimizely Data Platform Visitor Groups now supports multiple instances

The module V2.0 now supports multiple Optimizely Data Platform instances, allowing personalized content based on real-time segments and profile dat...

Andrew Markham | May 15, 2024 | Syndicated blog