Click here to Skip to main content
15,041,525 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All!. I am building a MVC5 based webApplication. There was a requirement to change the target framework to .NET 4.5. So i changed the target framework of the project from .NET 4.5.2 to 4.5. Now When i am running the codes from Visual Studio, it is throwing the error
C#
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.


And to my strange in my system i have IIS 7.5, but the error page coming showing title of the page IIS 10. When i reverted the target framework to .NET 4.5.2 also, same problem is occurring.

To add here, in the configured IIS 7.5 in my system, another mvc web application hosted in and it is working fine.

Kindly suggest how to fix this. Thanks in advance.

What I have tried:

I added the below lines of code to my web.config
C#
<system.webserver>
    .....
    <modules runallmanagedmodulesforallrequests="true">
   <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
  </system.webserver>

Run the below lines of code in command prompt

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i

Added the below pieces of code to web.config also
C#
<appsettings>
    ......
    <add key="enableSimpleMembership" value="true" />
    <add key="owin:AutomaticAppStartup" value="false" />
</appsettings>


But all in vain.
Posted
Updated 12-May-16 5:16am
v2
Comments
Foothill 12-May-16 11:49am
   
I just had this happen to me on a new Windows Server 2012 R2 server (IIS 8.5). What I had to do to fix this is to open the Server Manager -> Manage -> Add Roles and Features -> Server Roles -> Web Server (IIS) -> Web Server -> Application Development

These features are necessary for MVC 5 apps:
.NET Extensibility 4.5
ASP.NET 4.5
ISAPI Extensions
ISAPI Filters
Server Side Includes
Umesh2014 13-May-16 1:44am
   
Hi Foothill!
Thanks for your reply, but i have not deployed the MVC web application in IIS yet. I am running the code directly from Visual Studio (debugging) and its throwing me the Error
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

It would be helpful for me if you could suggest some fix for this.
Foothill 13-May-16 10:07am
   
You are getting this error on your Development machine when your web application is launched with IISExpress?
Umesh2014 16-May-16 1:08am
   
Yes, getting the error when the web application is launched with IISExpress. How to fix this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900