Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Henrik Fransas
Jan 28, 2019
  2458
(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
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog