Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

schedule job setting language



I'm running episerver cms 9 and have a Scheduled Job in my website. 

When then job is made to run (manually or using a time schedule) the current culture becomes english. I have tried changing that programmatically using e.g.

Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK", false);

contentRepository.GetDefault(...., CultureInfo.CurrentCulture)


or this code 

contentRepository.GetDefault(...., new CultureInfo("da-DK"))

 But both gives me an error saying: 

{"netContentCreateLanguage: LanguageBranchID is null, possibly empty table tblLanguageBranch"}

Oct 24, 2016 19:20

Enabled the language in admin/edit mode? Also remember access rights of course if running the job automagically :)

Are there pages with that culture already?

Maybe some small typo with culture string? Tried small chars?

Oct 25, 2016 6:58

The da language is already enabled. That is the default language.

The access right are giving dynamically using

PrincipalInfo.CurrentPrincipal = new GenericPrincipal(
new GenericIdentity("Scheduled TrafficInfoArchive"),
new[] { "Administrators" });

Alle the pages are with da culture, and the typo is correct. 

However the problem still exists.

Edited, Oct 25, 2016 12:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.