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?
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.
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.
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");
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?
Yes to both
Did you upgrade your site recently? Do your dll versions match up?
Please, sign in to be able to submit a new answer.