Trikks

The digital adventures of Eric Herlitz

Cannot change Language when UseCurrentUICulture is on

Posted by trikks on January 17, 2012

This error occurs since you forgot to set the UseCurrentUICulture to false when instantiating the MetaDataContext object

The error message looks something like this
MetaDataPlusException was unhandled
Cannot change Language when UseCurrentUICulture is on

To solve this you simple need to set the UseCurrentUICulture to false when instantiating your MetaDataContext object, in example

MetaDataContext metaDataContext = new MetaDataContext(connectionString)
{
    UseCurrentUICulture = false,
    Language = Capo.EPiServer.Constants.ProductCatalogConstants.DefaultLanguage
};

Cheers!

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: