Solved

Run MVC4 Internet Project Using IIS 7.5

Posted on 2014-02-18
5
677 Views
Last Modified: 2014-02-19
I’m trying to learn MVC4 and seem to have a problem running an MVC4 project using IIS 7.5.  I created a simple MVC4 Internet project using VS2012 and EF 4.0 with just the startup controllers and views.  

I can run the project in debug mode to display the home / index view and it works as expected.  For reference I named the site MyInvDF.  I have not added any data models yet but I have planned to use the Database First approach.  

Next I added the project to the site tree in IIS 7.5.

I created a virtual directory MyInv and created the default user of IIS7, IUSR and gave him full permissions.  Then I attempted to run the project by entering http://localhost/MyInv.  
When I do, I get the following message:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

(1)  Shouldn’t I be able to start the web site using its virtual folder?

When I run the website by entering http://localhost/MyInvDF, I get the following messages

Default Document ………. Enabled
Directory Browsing ……… Enabled
Message ……………………..  List of files in root folder

Default Document ………. Enabled
Directory Browsing ……… Disabled
Message ……………………..  HTTP Error 403.14 – Forbidden - The Web server is configured to not list the contents of this directory.

(2)  How can I run this site using ISS7.5 so that it loads home/index view?
0
Comment
Question by:deepPowdah
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:apeter
Comment Utility
1. Does the IIS Site has proper .net framework selected ?. You have to do in the application pool settings.

2. If you put a dummy html in your web site, does that opening ?

3. Is deployed properly ?  Under the site, can you see all the views, config , bin folders etc ?
0
 

Author Comment

by:deepPowdah
Comment Utility
Thanks for your reply.

If I add an index.html page it does open correctly.

Do I need to deploy the project to run it under IIS?
0
 
LVL 25

Expert Comment

by:apeter
Comment Utility
Yes,  you have to publish/Deploy your code to the IIS site. Right click on the "web project", select "publish" option to deploy. One of the publish option is "to local folder" , here you can point to your site folder.
0
 

Author Comment

by:deepPowdah
Comment Utility
One More quick question -  When I developed ASP.net web site, there were some inconsistencies between running the site with Cassini, vs IIS.  So I typically viewed the site under IIS.  

Do you and other professional MVC developers use the debug button to view your pages in development and not use the deploy capability until you are ready to actually deploy the site?
0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
Comment Utility
Yes,  until ready you can debug from Visual studio, which uses temporary IIS.  

But you can also debug from IIS in your development machine, using below steps.
1. Create a site in dev machine
2. Deploy or publish to your site from step 1.
3. Browse the application in a IE browser
4. Load the project in visual studio, go to menu "Debug->Attach to Process" option and select the IE process (step 3)
5. After attaching you can put breakpoint in visual studio . As and when you navigate in the browser, the break point will be hit accordingly.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

772 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

14 Experts available now in Live!

Get 1:1 Help Now