Run MVC4 Internet Project Using IIS 7.5

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?
deepPowdahAsked:
Who is Participating?
 
apeterConnect With a Mentor Commented:
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
 
apeterCommented:
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
 
deepPowdahAuthor Commented:
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
 
apeterCommented:
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
 
deepPowdahAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.