ASP.NET MVC: the page works by default, but other pages return a 404 error

I created the Hello World app, in the same vein as http://giantflyingsaucer.com/blog/?p=409 . It works fine on my development computer using the embedded web server.

I followed Phil Haack's advice for using Bin Deployment at http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx . I used the Publish function to get the output directory and copied all the files to the right places in ISP (Network Solutions).

When I go to the site, I get a welcome page, but when I do http: // mydomain / hello , I get 404 error.

What could be the problem?


Here is the fix. Network Solutions seems to be running IIS6. I got what I need from http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/ . New routing

{controller}.aspx/{action}/{id}

Note the addition of .aspx after the controller placeholder. IIS6 needs this because it always thinks that it is talking to a real web page, not a controller.

I'm not addicted to extra characters in the url, but I may have to live with it.

+1
source share
4 answers

Are you sure you deployed it to the IIS7 server? If the server starts IIS6, check this and this post .

+3

. , ASP.NET MVC ? , MVC- BIN.

+1

This is a long shot, but it happened very honestly with me today. Are you sure IIS is fully configured? In the node web service Extensions section, enable / enable ASP.NET. If this is not allowed, you will get a 404 error.

0
source

I had problems with 404 errors until I copied "PrecompiledApp.config"

0
source

Source: https://habr.com/ru/post/1713299/


All Articles