I couldn't find any information about this error anywhere and it's really strange!

When I open the root-level Navigation settings page in my SharePoint 2010 website, I get an error page and the following message can be found in the Event Viewer: Exception type: InvalidCastException Exception message: Unable to cast object of type 'Microsoft.SharePoint.Publishing.CachedListItem' to type 'Microsoft.SharePoint.Publishing.CachedPage'.

I've tried clearing all of the SharePoint 2010 related caches but that didn't work. I also haven't modified any part of the root level navigation in a long time. I think the last time I opened the page was a month ago or so!

Any ideas?

The master page I'm using is is v4.master.

Cheers guys!


Alright so this turned out to be a really random problem!

So I started developing this site on one server, then our server infrastructure got updated so I backed up the site collection and moved it to the new server. I had left the /Pages/default.aspx checked out and when I tried to view the /Pages library in the new server it was always empty. When I tried to create default.aspx manually SharePoint always gave me an error so I decided to rename the old Pages library to Pages2 and then create a new Pages library manually. When I then copied my default.aspx page to the new library everything worked EXCEPT that when I open the root level Site Settings -> Look and Feel -> Navigation I get the InvalidCastException error.

So when I delete my manually created Pages library and rename the old Pages2 library to Pages the navigation settings page doesn't give me an error anymore! Now I will have to delete the default.aspx that SharePoint tries to hide from me using PowerShell I guess..

Hopefully this helps someone else!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.