?
Solved

Run MVC4 Internet Project Using IIS 7.5

Posted on 2014-02-18
5
Medium Priority
?
704 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

764 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