?
Solved

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

Posted on 2011-02-22
5
Medium Priority
?
1,970 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 2000 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 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

770 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