In this tutorial, you will learn how to fix "MenuHelper is an ambiguous reference" error when working with SitecoreCMS. After upgrading Sitecore from v7.5 to v8, whenever I tried to view the 'Experience Optimization' or ' Experience Analytics' pages from within the Sitecore dashboard, I encountered this error:
As the exception suggests, the reason the page is falling over is because of an ambiguity in namespaces between Sitecore.Web.UI.Controls.Navigation.Menus.MenuHelper
and MvcSiteMapProvider.Web.Html.MenuHelper
.
The project in question was using the MvcSiteMapProvider
Nuget package which was causing a conflict. Sitecore has now released a patch to fix this error. To resolve this conflict without a patch, add the full namespace within the /menus/Menu.cshtml
object. This file can be accessed in Sitecore here:
On line 25 add the code in bold:
After saving the file, and reloading the site it should now load sucessfully. Happy Coding 🤘