1

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

3
  • Shouldn't it be "{controller}.mvc/{action}" ? Commented May 5, 2009 at 10:25
  • You said "yes its checked" - it should be unchecked? Commented May 5, 2009 at 10:47
  • from my understanding, it shouldn't matter. I tried it anyway but still getting 404's Commented May 5, 2009 at 10:47

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

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>

3 Comments

added this to web.config and still same problem. Starting to think local environment is the issue.
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
Also note - despite the title of this Question - this had nothing to do with IIS 6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.