Xml files stop being served by IIS6 after allowing .net to process the .xml extension

Posted by Brian Surowiec on Stack Overflow See other posts from Stack Overflow or by Brian Surowiec
Published on 2010-05-30T06:56:10Z Indexed on 2010/05/30 7:02 UTC
Read the original article Hit count: 315

Filed under:
|
|

I added a route into my site to allow for a sitemap and everything worked fine in IIS7 but once I deployed the route stopped working. Since the live server is running IIS6 I needed to put a new mapping in for .xml to be processed by .net and then it started to work.

My issue though is on every other xml file on the site now. I keep getting a 404 error when trying to view xml files, but the sitemap.xml route works. Is this a routing issue or an IIS setup issue?

Here are my routes if it will help

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
    "Gallery-Group-View",
    "Projects/{groupId}",
    new { controller = "Gallery", action = "GalleryList", groupId = "" });

routes.MapRoute(
    "Gallery-List-View",
    "Projects/{groupId}/{galleryId}",
    new { controller = "Gallery", action = "GalleryView", groupId = "", galleryId = "" });

routes.MapRoute(
    "Sitemap",
    "Sitemap.xml",
    new { controller = "XML", action = "Sitemap" }
);

routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = "" }
);

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about iis6