Sizzling Code
Sizzling Code

Reputation: 6070

ASP.NET MVC 5 using Ninject | The SiteMapLoader has not been initialized

I am using Visual Studio 2013 and haved opened a Project in MVC 5. I wanted to have dynamic breadcrumbs in my website. I searched Google and found the question related to mine on stackoverflow.

http://stackoverflow.com/questions/1066777/how-can-dynamic-breadcrumbs-be-achieved-with-asp-net-mvc

So i went for SiteMapProvider, i installed the package using nuget, but after installing it i am getting this following error.

The SiteMapLoader has not been initialized.

Check the 'MvcSiteMapProvider_UseExternalDIContainer' setting in the AppSettings section of web.config.

If the setting is set to 'false', you will need to call the MvcSiteMapProvider.DI.Composer.Compose() method at the end of Application_Start in the Global.asax file. Alternatively, if you are using .NET 4.0 or higher you can install the MvcSiteMapProvider.MVCx NuGet package corresponding to your MVC version.

If the setting is set to 'true', you must set the SiteMaps.Loader property during Application_Start in Global.asax to an instance of the built-in SiteMapLoader type or a custom ISiteMapLoader instance. This can be achieved most easily by using your external DI container.

enter image description here

enter image description here

enter image description here

Ninject is Also installed. i am not sure why i am getting the error. i have not done any settings only installed.

As in this below link there was no settings needed.

http://maartenba.github.io/MvcSiteMapProvider/getting-started.html

How to fix this error and make breadcrumbs work.

Upvotes: 0

Views: 2374

Answers (1)

Tau
Tau

Reputation: 468

I faced similar issue, solved it by installing the MvcSiteMapProvider.MVC5.DI.Ninject package

https://www.nuget.org/packages/MvcSiteMapProvider.MVC5.DI.Ninject/

To use Ninject with MvcSiteMapProvider some configurations and classes are needed which are installed by this package.

I also didn't do any configuration, worked for me at first run.

Upvotes: 2

Related Questions