Error in Application \

The DataSourceID of ‘TopNavigationMenu’ must be the ID of a control of type IHierarchicalDataSource. A control with ID ‘topSiteMap’ could not be found.

I came across this error today when I tried to browse our hosts-QA site. It was strange because only hosts was affected, not Apps or Works or ShareIt.

After a fair amount of Googling I came across an article by Corey Roth that got me pointed in the right direction. His suggestion was to search the ULS logs for “SafeMode” and see if I could determine a sequence of events that may have led to the issue. In his case, it was a webpart dll file that had not completely loaded. I did not think that was necessarily the case, because nothing had been added to this system recently.

In the process, I found myself needing to search many files for a specific term, so I googled and came up with FileLocator Lite as a free way to accomplish this. Installed FileLocator Lite onto my machine and copied over the ULS logs to a folder on my desktop. Ran the search, and found one file with hits. Went into that file and did not see anything specific that I could use to solve the problem. Went back to Corey’s article and found a second search to try was "The system cannot find the file specified". This search returned a hit to a log with the following info:

DelegateControl: Exception thrown while adding control ‘Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapDataSourceSwitch’: Could not load file or assembly ‘CustomSiteMap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=03bfa7e0104a6943’ or one of its dependencies. The system cannot find the file specified. (C:\inetpub\wwwroot\wss\VirtualDirectories\umdsphostsqa.umd.edu443\web.config line 452) 7e563aae-0262-4fa8-803f-62da346c79ea

So this pointed me to line 452 of the web.config, where sure enough there was a Custom Site Map defined

<add name="SPISiteMap" type="CustomSiteMap.SPISiteMap, CustomSiteMap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=03bfa7e0104a6943" />

I removed this line from the web.config and restarted the site in IIS and everything started to work.

The question now is why did this happen in the first place? How did the custom site map get added to the web.config.

Leave a comment