1

Someone has asked me to look at their code to do a few little changes to the processing, but before I can get anywhere, I can't even run up the main page. It seems to be MVC, seems to have the right routes etc. It defaults to a ~/home from default.aspx and there seems to be a route in place, but I get a 404.

I've tried changing the route and it still fails. I've debugged and it seems to be setting the routes up. I've set up Phil Haack's debug utility but it still just gives me a 404.

I'm quite new to asp.net MVC, but I've done asp.net and know some MVC (CakePHP) and I'm not really working with the MVC, just some processing code. Are there any big "gotchas" I should be looking for?

2
  • Are you getting this when debugging inside visual studio or do you see it after deployed to IIS? Commented Oct 9, 2009 at 20:20
  • J.W. It happens inside Visual Studio. Commented Oct 10, 2009 at 1:04

3 Answers 3

1

There is a Default.ASPX page that is included in the root path by default in all ASP.NET MVC projects. It has a comment in it that says:

Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server.

You might want to check and see if it is still there.

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

1 Comment

Thanks. When I looked at the file, I found that there was actually a redirect that doesn't look like the current version. It appears that the problem is that whoever built the system did so on asp.net mvc preview 5, so a whole load of changes are going to be required (probably uninstalling MVC, re-installing and then creating a new MVC project and copying it all in. I've changed the config and got some of it working, but I think I need these draconian changes.
1

Are you running the app on IIS 6? If so, the problem is that IIS only invokes ASP.NET when it sees a .aspx extension in the URL. This can be fixed in a number of ways, described, for instance, here and here. I solved the problem changing IIS options to use aspnet_isapi.dll for all files (that is, *).

1 Comment

You've given me a clue as to what it might be. I checked the web.config of their file and that of a new MVC site and there seemed to be things missing from theirs. I wonder if I need to set up IIS7 and try and install it under that. Is there anything required for IIS7 and MVC do you know?
0

The problem was that the project was built on asp.net MVC Preview, and I already had asp.net MVC v1 installed, which seemed to create some sort of conflict.

I've removed asp.net MVC and the problem has gone away.

Comments

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.