Quantcast
Channel: MvcSiteMapProvider - not generating sitemap.xml - Stack Overflow
Viewing all articles
Browse latest Browse all 2

MvcSiteMapProvider - not generating sitemap.xml

$
0
0

Edit: It seems like there is trouble with my Routeconfig.cs. When I removed everything except the most basic routing I can find my sitemap.xml. I'll investigate and come back with an answer.

-

I have installed MvcSiteMapProvider.MVC4 through Nuget in my MVC4 project.

My Mvc.sitemap looks like this (it's as I got it through Nuget)

<?xml version="1.0" encoding="utf-8" ?><mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"            xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0"            xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0 MvcSiteMapSchema.xsd"><mvcSiteMapNode title="Home" controller="Home" action="Index"><mvcSiteMapNode title="About" controller="Home" action="About"/></mvcSiteMapNode></mvcSiteMap>

I have corresponding controllers and actions in my project (although my Homecontroller has more actions which I havn't writted out in the schema)

At the bottom of my RouteConfig.cs I added this like

MvcSiteMapProvider.Web.Mvc.XmlSiteMapController.RegisterRoutes(routes);

Everything compiles fine and I have made no other alterations to the code.

But when I go to localhost:xxxx/sitemap.xml I find no file (The resource cannot be found.). I was under the impression that this would work out of the box. Am I missing something?

Other things MvcSiteMapProvider does like @Html.MvcSiteMap().SiteMap() works just fine, but it simply does not generate the sitemap.xml.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>