Error using API: The object type 'cms.document' is missing the provider type configuration

Andre Pfanz asked on May 31, 2016 16:13

I'm trying to access a tree node using the following code:

var treeProvider = new TreeProvider();
TreeNode node = DocumentHelper.GetDocument(new NodeSelectionParameters { Where = string.Format("NodeID = '{0}'", websiteNodeID) }, treeProvider);

However, this is getting the following error:

An unhandled exception of type 'System.Exception' occurred in CMS.DataEngine.dll

Additional information: [AbstractProvider.GetProvider]: The object type 'cms.document' is missing the provider type configuration.

Any idea what the problem could be?

Correct Answer

Andre Pfanz answered on May 31, 2016 22:24

I corrected this. I was running a console application on my local computer and copied all the DLLs from the bin folder on our Kentico server to my local bin folder and got rid of the error. Thanks for your help.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on May 31, 2016 16:18

What version are you using of Kentico? If you look here: https://docs.kentico.com/display/API9/Pages you should see how to do this in version 9.

1 votesVote for this answer Mark as a Correct answer

Andre Pfanz answered on May 31, 2016 16:41

I'm using version 9 of Kentico. I am aware of the page you mentioned and tried using the following code but still get the same error:

TreeProvider tree = new TreeProvider();
TreeNode n = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/Portfolio/Projects/11000 Equity Drive", "en-us");
0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on May 31, 2016 19:52

Are you sure that yours are using the documentengine? Does your page specify the correct using statement:

using CMS.DocumentEngine;

When you hover over your TreeProvider class in Visual Studio, does it mention that class?

0 votesVote for this answer Mark as a Correct answer

Andre Pfanz answered on May 31, 2016 20:14

Yes to both

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on May 31, 2016 21:33

Did you upgrade your site recently? Do your dll versions match up?

0 votesVote for this answer Mark as a Correct answer

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