8

So I have all the updated code, the entire solution builds. It works on everyone else's machine, however when I try and access localhost/extranet on my machine, it gives me this error:

HTTP Error 403.14 - Forbidden

Detail Error Info:

Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler 0x00000000
Requested URL   http://localhost:80/extranet/
Physical Path C:\svn\K2\trunk\appteam\web\Chatham.Web.UI.Extranet\
Logon Method Anonymous
Logon User Anonymous

Now I tried going into IIS7, and enabling directory browsing, this removed the error, but still didn't bring up my website. I also tried going in and disabling the default document, re-enabling it, everything, nothing worked. I've also restarted IIS a few times to no avail.

Any ideas?

slandau
  • 23,528
  • 42
  • 122
  • 184
  • Can you access even a plain HTML document on the site through your browser? – Hector Correa Oct 24 '11 at 19:32
  • 1
    You probably just need to give the AppPool user for your website access to that directory. Generally, the AppPool account only has access to `\inetpub\MyWebApplication`. – scottm Oct 24 '11 at 19:33
  • @HectorCorrea, I haven't tried, as ISAPI is supposed to redirect to the correct page. – slandau Oct 24 '11 at 19:34
  • @scottm - How would I do that? – slandau Oct 24 '11 at 19:35
  • I ran into this when I switched my app to "precompiled", because it removes the global.asax from the directory. switching off the "precompiled" option when I published the app brought back the globalasax file and resolved the issue for me. – Glenn Ferrie Apr 03 '20 at 20:25

8 Answers8

10

It sounds like your IIS is not processing the routing rules for your application and is trying to find a default.aspx, index.htm, etc. Since it cannot, it is wanting to display the directory listings (which is why you were getting the 404.14).

I just checked my dev setup and I think that your AppPool has to be set on Integrated as opposed to Classic on the Managed Pipeline for the AppPool. I have ran into this before, there may be ways to use the Classic Pipeline, but this would/should be the quickest way to resolve your issue. To check/change the pipeline mode, click on Application Pools from the menu on the left side of IIS, find your AppPool and look in the managed pipeline column. If it is set to Classic -> Right click the AppPool, choose basic settings, then change the dropdown from Classic to Integrated.

If I am incorrect, someone please feel free to correct me on this in the comments.

Edit - Just to add, you can run an MVC app in the Classic Pipeline mode, but you have to do the IIS 6 tricks to get it to work properly. Mainly, you need to turn on wildcard script mapping for MVC to work in Classic mode, If not it expects an .aspx file (or similar) to exist for it to handle the execution pipeline over to .NET from IIS.

Tommy
  • 39,592
  • 10
  • 90
  • 121
6

Causes this error is removed Global.asax file from your root directory of your site.

To solve this problem add a Global.asax file to your project.

See here: How to add Global.asax file to ASP.NET MVC4 project

Community
  • 1
  • 1
Samiey Mehdi
  • 9,184
  • 18
  • 49
  • 63
  • Thank god! I got this before and had fixed it, and was tearing my hair out when it happened again. Clicked the second I read this comment. – Paul Connolly Feb 20 '14 at 08:49
3

My solution was because I didn't have ASP.NET installed via "Turn Windows Features on and Off" so it was simple. I figured it out by enabling directory browser and trying to go to my views folder which then gave a more descriptive answer and pretty much said that there was a problem with a module because ASP.NET is not properly installed. It then dawned on my to go and install it.

Daniel Jackson
  • 1,036
  • 1
  • 11
  • 35
3

In IIS, you need to find out which app pool your application is running from. Just right click the web application under Sites>Manage Web Site>Advanced Settings. The first property should be the app pool.

Now, click Application Pools. You should see a column called "Identity". Add that user to the ACL of the C:\svn\K2\trunk\appteam\web\Chatham.Web.UI.Extranet\ directory. If it just says 'ApplicationPoolIdentity', it can be a little tricky figuring out the user. If it's just running under DefaultAppPool, you can use IIS AppPool\DefaultAppPool.

scottm
  • 27,829
  • 22
  • 107
  • 159
  • Yes it says `ApplicationPoolIdentity`. I checked your link but I'm not really sure where to go from here... – slandau Oct 24 '11 at 19:48
  • @slandau, Which app pool is your application running under? – scottm Oct 24 '11 at 19:53
  • Then you need to right click on your folder (`\svn\K2...\Chatham`), go to Properties and under the Security tab, add the user `IIS AppPool\Classic .NET AppPool` with at least read permissions. – scottm Oct 24 '11 at 19:56
  • You might need to change the Location in the Select Users or Groups dialog to your machine, not a domain. – scottm Oct 24 '11 at 20:10
  • Okay got the name added, however that still didn't fix the issue. I'm thinking it has something to do with ISAPI ReWrite. – slandau Oct 24 '11 at 20:12
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/4493/discussion-between-scottm-and-slandau) – scottm Oct 24 '11 at 20:14
2

Change the 'start page' by right click on the page and select 'Set as Start Page' that you want to open first when the web application starts first. This might solve your problem. :)

0

Also make sure in IIS Application Pool settings that Enabled 32-bit Applications under Advanced Settings is set to FALSE. I spent hours trying to fix this and that was my issue. Windows Server 2012 IIS 8.5

neminem
  • 2,658
  • 5
  • 27
  • 36
0

I solved this problem by setting exact .net framework. My website was using v4.0 version of .net.

  • Workaround to handle the problem:
    1. Open command line as an administrator
    2. Go to directory "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
    3. Execute the following: aspnet_regiis.exe -i
    4. Open IIS and change Pipeline Mode of Your application to Integrated

Hope this helps

0

In my case the HTTP Redirection feature was missing on the server (with IIS 10).

Adding the feature resolved the issue and the site started to load fine.

enter image description here

Gyula Kósa
  • 151
  • 1
  • 13