MvcSiteMapProvider installation error

I got this error while installing sitemapprovider for mvc:

Install-Package : Updating 'Microsoft.AspNet.Razor 3.2.2' to 'Microsoft.AspNet.Razor 2.0.20505.0' failed. Unable to find versions of 
'Microsoft.AspNet.WebPages, Microsoft.AspNet.Mvc' that are compatible with 'Microsoft.AspNet.Razor 2.0.20505.0'.
At line:1 char:1
+ Install-Package MvcSiteMapProvider.MVC4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

      

+3


source to share


1 answer


The error indicates that you are installing the MvcSiteMapProvider.MVC4 NuGet package , but your MVC 5 project (since it has Razor 3.2.2), you must install the package that matches your MVC version (in this case, MvcSiteMapProvider.MVC5 ) into your project.

PM> Install-Package MvcSiteMapProvider.MVC5

      



Please note that the MvcSiteMapProvider NuGet package is deprecated and should not be installed in any project unless you intend to use MvcSiteMapProvider v3.x.

If you are upgrading from MvcSiteMapProvider v3 to v4, see the upgrade guide .

+5


source







All Articles