Solved

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

Posted on 2011-02-22
5
1,948 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 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