November Happy Hour will be moved to Thursday December 5th.

Henrik Fransas
Jan 28, 2019
  2882
(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 SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog