From f6e841632828bf1a1964f2d70fd64f4231688b76 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Fri, 1 Nov 2013 00:19:24 +0700 Subject: [PATCH] Fixed install.ps1 in MvcSiteMapProvider.Web to install the system.webServer config sections (#124). --- nuget/mvcsitemapprovider.web/tools/install.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nuget/mvcsitemapprovider.web/tools/install.ps1 b/nuget/mvcsitemapprovider.web/tools/install.ps1 index 75c80e19..44f169c1 100644 --- a/nuget/mvcsitemapprovider.web/tools/install.ps1 +++ b/nuget/mvcsitemapprovider.web/tools/install.ps1 @@ -301,12 +301,17 @@ if ([string](InferPreferredViewEngine) -eq 'aspx') { (Get-Project).ProjectItems | ?{ $_.Name -eq "Views" } | %{ $_.ProjectItems | ?{ $_.Name -eq "Shared" } } | %{ $_.ProjectItems | ?{ $_.Name -eq "DisplayTemplates" } } | %{ $_.ProjectItems | ?{ $_.Name -eq "MenuHelperModel.ascx" -or $_.Name -eq "SiteMapHelperModel.ascx" -or $_.Name -eq "SiteMapNodeModel.ascx" -or $_.Name -eq "SiteMapNodeModelList.ascx" -or $_.Name -eq "SiteMapPathHelperModel.ascx" -or $_.Name -eq "SiteMapTitleHelperModel.ascx" -or $_.Name -eq "CanonicalHelperModel.ascx" -or $_.Name -eq "MetaRobotsHelperModel.ascx" } } | %{ $_.Delete() } } -# If MVC 4, install web.config section to fix 404 not found on sitemap.xml (#124) +# If MVC 4 or higher, install web.config section to fix 404 not found on sitemap.xml (#124) if ($project.Object.References.Find("System.Web.Mvc").Version -eq "4.0.0.0") { Write-Host "Detected MVC 4" Add-MVC4-Config-Sections } +if ($project.Object.References.Find("System.Web.Mvc").Version -eq "5.0.0.0") +{ + Write-Host "Detected MVC 5" + Add-MVC4-Config-Sections +} # Fixup the web.config files Add-Or-Update-AppSettings