tags:

views:

47

answers:

2

Having a problem deploying an MVC application.

Basically the site loads correctly, the home page appears. However anything which needs to access a controller action does not. So all the links just throw up 404 errors.

Does anyone have an Idea why the site loads but after that the controller actions appear not to?

Thanks

A: 

The fact that the home page appears indicates that you have at least one controller working properly. Namely, the HomeController.

You should check that you are following the default conventions (if you have it set up that way)

Controllers belong in the Controllers folder and follow the naming convention [Name]Controller.

Also, every action in the controller must be public and must return an ActionResult of some kind. Returning a View will cause a particular View to be rendered.

Also, Views follow the folder structure View/[ControllerName]/[Action].aspx

The fact that the first page loads means you probably have Home/Index set up properly for both your Controller and your View. You should take a look at those and see what the difference between that is and the other controllers/actions/views that you've set up.

Joseph
All of it works locally, it is in deployment in which it breaks.
Damien
@Damien ah I see. Then you probably have some IIS configuration issue in that case. DaveG has the right idea on this one I think.
Joseph
+1  A: 

Are you running your app in IIS 6? If so you'll need to configure the .mvc extension or configure wildcard mapping. Steve Sanderson has a good post on it.

David G