Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Deploy MVC 5 .Net web to IIS 7.5 (Win2008 R2)

Posted on 2014-11-23
15
Medium Priority
?
2,284 Views
Last Modified: 2014-11-25
Hi,
we have developed a sample site in Visual Studio 2013 using asp.net and C#.

When we run it from the IDE (VS2013) it works ok, but when we deploy it to our IIS 7.5 site it displays a message saying "Error HTTP 403.14 - Forbidden" (web server not configured to browse content directories)

If we try "http://localhost" the IIS site works ok.

Can you please help with this issue?
Thanks.
0
Comment
Question by:José Perez
[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
  • 8
  • 6
15 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40461462
How are you browsing to the "page"? You need to include a controller and possibly an action in the address bar when you navigate. If you are directly on the server, and if you are trying to browse via IIS Manager, then I believe it default to showing the application root. Include the full destination in your address bar, and it should come up.
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40461486
Did you tried suggestion at link Deploying ASP.NET MVC 3 to IIS 6?

Replace MVC3 to MVC5 and IIS 6 to IIS 7.5. I hope it would help you to deploy website properly. Then test.

Share your testing results.
0
 
LVL 2

Author Comment

by:José Perez
ID: 40462166
This is my RouteConfig.cs file in VS2013
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Myiisserver
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}

Open in new window


It is supposed that if a user goes to : http://myiisserver/ the  Home page is displayed immediatelly, and that's the way it works in Visual Studio, but when deploying to IIS it does not load :(
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 2

Author Comment

by:José Perez
ID: 40462177
Attached is the inetmgr.exe screenshot.
IIS.png
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40462328
Questions -

1. Share your steps for deployment
2. You didn't answered to kaufmed comment.
3. Did you tried suggestions on link I shared with you?
0
 
LVL 2

Author Comment

by:José Perez
ID: 40462418
I have followed suggestions.
The Controller is 'Home' the Action is 'Index', if I try http://localhost/myiisserver/Home/Index it says "Resource not found" if I only type "http://localhost/myiisserver/" it displays the iis site folder structure.

Attached is the folder structure of the deplyment to IIS.
iis-folder-structure.png
0
 
LVL 2

Author Comment

by:José Perez
ID: 40462455
I found the solution for Windows 8 at Register ASP.NET in IIS 8 on Windows 8

but for Windows Server 2008 R2 I don't know how to do same steps above (in the Server Manager / Features)
Can you please guide me?
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40462636
I faced such issue. So here are notes from diary -

1. Go as per snapshot First - Install features as .Net Framework

Install .Net 4.0 or 4.5 framework as per snapshot
2. Go as per snapshot Second - Add role  services

Add role services so as to make ASP (or MVC) stuff work on Window Server 2008
3. Open cmd on Window Server 2008, and type following command -

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

Replace %windir% by your actual window directory path.

For e.g. C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir  for registering Asp.Net 4.0 if it isn't yet.

4. Restart your system. Deploy your website with DefaultAppPool set to Asp.Net 4.0. Ensure your deployed website to be using same pool.

Test and share testing results.
0
 
LVL 2

Author Comment

by:José Perez
ID: 40462805
It now displays the folder structure list with files. Still does not displays the webpage.
0
 
LVL 2

Author Comment

by:José Perez
ID: 40462813
Here is the image...attached.
iis-folder-structure-iis-server.png
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40463748
Show me snapshot of your system similar to second snapshot I shared with you.

I need to ensure if all steps followed as I asked to do.
0
 
LVL 2

Author Comment

by:José Perez
ID: 40463786
Finally I found the issue... had to configure 'Application Group' in IIS. Change from DefaultAppPool (2.0) to "ASPNet v4.0"
See. Attached image.
Solucion-Deploy-MVC-a-IIS-Windows-2008-S
0
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 2000 total points
ID: 40463796
So that mean you didn't followed suggestions (exactly) in comment id ID: 40462636 where I mentioned as

4. Restart your system. Deploy your website with DefaultAppPool set to Asp.Net 4.0. Ensure your deployed website to be using same pool.
0
 
LVL 2

Author Comment

by:José Perez
ID: 40463803
wow I missunderstood that line to exactly the opposite, sorry.
anyways, you deserve the points.
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40463806
Well! You deserve points too for working on it consistently.

That's why I enjoy development. Because here exists solution to any issue unless we find it.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

722 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