views:

149

answers:

2
+1  Q: 

MVC with IIS 6

Hi there, I've read a couple of posts on this issue but still can't seem to get MVC working on IIS 6. I've mapped .mvc to aspnet_isapi.dll in IIS but get a 404 when I browse to my mapped URL which looks like this

RouteTable.Routes.MapRoute("action", "api.mvc/{controller}/{action}", new {action = "Index"});

I then browse to //localhost/Web.Site/api.mvc/Users/List but get a 404 returned

same happens for

//localhost/Web.Site/api.mvc/Users/

I have a UsersController with List and Index that both returns a ViewAction

Is there anything else I need to do? Or have I missed something

cheers

also.............

I should point out that my redirect my default page in the website is working

eg my default code behind has

        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current);

so the default "/" request does get correctly routed via this in the global.asax.cs

        RouteTable.Routes.MapRoute("default", "", new {controller="Home", action = "Index" });

not sure if that helps anyone

+2  A: 

Have you unchecked the "Verify that file exists" box on the extension mapping?

Marc Gravell
yes its checked. Still no good
Gilly
Is that a typo? It should be unchecked...
Marc Gravell
sorry - typo - its unchecked
Gilly
+1  A: 

Try deleting your default.aspx page and make sure you have this in your web.config:

<httpModules>
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing"/>
</httpModules>
Dave Newman
added this to web.config and still same problem. Starting to think local environment is the issue.
Gilly
I'll give you this even though it wasn't quite right. As I said I added that and still same problem. But when I added the entire god-awful-mess that gets generated when you create a MVC project and it works. I need to now go through it cull all the stuff I don't need.cheers
Gilly
Also note - despite the title of this Question - this had nothing to do with IIS 6
Gilly