0

I have an MVC 4 project which uses MVC Site map provider for it's menu.

The project has some customised (in terms of CSS classes) templates such as ~\Shared\DisplayTemplates\MenuHelperModel.cshtml which according to the docs are the right locations for them.

Unfortunately the template classes are not applied (but the menu content itself is shown) so I see the unstyled menu.

The following three NuGet packages are installed at version 4.4.7:

  • MvcSiteMapProvider.MVC4
  • MvcSiteMapProvider.MVC4.Core
  • MvcSiteMapProvider.Web

I've tried updating the version to 4.6.22 but to no avail.

All I could find on SO was this post: MVCSiteMapProvider won't use Razor Templates for Menu but that indicates that changing the view location may be the problem, whereas mine is using the defaults.

Is there some hidden config or method I can use to debug this? really struggling to find anything.

Community
  • 1
  • 1
dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
  • I suggest creating a new MVC 4 project to see if you have the same problem. If not, then compare the web.config settings (both root and Views\web.confg) to see what is causing this. BTW, the shared location is `~\Views\Shared\DisplayTemplates`, not `~\Shared\DisplayTemplates` as you have in your question. – NightOwl888 Apr 07 '17 at 20:03
  • This was caused by some .NET reference issues. The original project would have had MVC4 installed in the GAC but my newer win10 VS2017 project wouldn't have. I had to update all the references to the MVC4 nuget references. Don't be tempted to remove the `System.Web.Mvc` references and try to get it working with the newer `System.Web` stuff (which I tried once). It might fix intellisense but it's not the right solution – dougajmcdonald Apr 09 '17 at 20:55

0 Answers0