Solved

Run MVC4 Internet Project Using IIS 7.5

Posted on 2014-02-18
5
691 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
[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
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 39870019
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
ID: 39870240
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
ID: 39870430
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
ID: 39870575
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
ID: 39870622
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 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