Solved

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

Posted on 2011-02-22
5
1,934 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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