Solved

Getting HTTP 404 error accessing an ASP.NET MVC 1 website deployed to local machine

Posted on 2011-02-22
5
1,889 Views
Last Modified: 2013-11-08
I've just started working with MVC, my MVC compiled error-free in Visual Studio 2008

Views folder has 2 sub-folders: Shared and User

On my local Vista PC I set up a web app in IIS 7.0, the physical path is c:\inetpub\wwwroot\MyAppName (basically I followed exactly what shall be done in IIS Manager) and I set it to be the default website (and the only website) in IIS - other attributes are Type: http; IP Address : All Unassigned, Port: 80 and Hostname left empty in the Add Web Site Dialog Box

So as I browsed to http://localhost I have gotten this error 404

Server Error in '/' Application.
--------------------------------------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

am I missing something? I don't need to rename User to Home, do I? (I actually did this and it made no difference.)

Also, before going to IIS issue, how do I view my MVC project (login.aspx) in Visual Studio 2008? Doesn't it have a built-in webserver already? (I didn't create any Unit Test when first setting up my MVC project, so I couldn't do "Start Debugging" or "Start w/o Debugging" to view webpages, nor could I do 'View in Browser' from  the context menu because there's no such thing as I right click on all of the .aspx files in the Views/User folder (it's so different from WebForm development)

Can someone please tell me what I shall do in VS 2008 and IIS 7 to test my pages?
(I've ruled out the wildcard mapping issue that only applied to IIS 6 and below; and also have .net Framework 3.5 SP1 and ASP.net MVC install on my Vista PC)
0
Comment
Question by:MercuryKT
5 Comments
 
LVL 9

Expert Comment

by:suvmitra
ID: 34962167
you should check again your IIS whether it is up and running properly or not. Manage the service by restarting it again and browse the default site. Default this settings are always needs to configured from client end.
0
 
LVL 10

Accepted Solution

by:
pramodsk40 earned 500 total points
ID: 34963593
check the correct path/Routes defined in MVC global.asax...
0
 
LVL 5

Expert Comment

by:WebDOT
ID: 34965515
Check this:

In IIS Manager, click on your server name.
Open up "ISAPI and CGI Restrictions"
Make sure your version of ASP.NET is allowed.

If your version of .NET is not allowed, IIS likes to throw 404 errors (even though the page is there).
0
 
LVL 10

Assisted Solution

by:pramodsk40
pramodsk40 earned 500 total points
ID: 34970735
0
 

Author Comment

by:MercuryKT
ID: 34994765
The reply with path/Routes defined in MVC global.asax helped. I have moved on with my current project and as I tested it on IIS I've got a differnt issue.

Please see it here
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

WHY MVC is the future technology... As many of you know, MVC is Model,View,Controller pattern. Model View Controller pattern was invented in a Smalltalk context at Xerox in late 1970s. Why is this buzz about MVC: --------------------------- …
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now