Error asking to call IPageDataContextInitializer.Initialize method only on cloud host

Mike Young asked on May 15, 2021 04:50

I'm having a problem where my site runs perfectly locally but when I deploy it to Azure I get the following error on the homepage:

InvalidOperationException: Missing page context data. If required use IPageDataContextInitializer.Initialize method to initialize the context manually. For POST actions use HtmlHelper extension method Html.Kentico().PageData() to persist the page context.

I am using content tree based routing which works fine locally and from what I understand content tree routing doesn't require manual initialization for context. I've even set Azure as a dev environment in the config so it matches the same startup routine as my localhost. Any ideas? Thanks in advance.

Correct Answer

David te Kloese answered on May 17, 2021 14:51

Hi,

Is this a project you have upgraded from an earlier version?

I've seen this error when old DLL's where not removed on the target in Azure. Try removing everything and do a clean deployment.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Mike Young answered on May 17, 2021 23:39

Thank you David! That did the trick.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.