27

Possible Duplicate:
ASP.NET MVC on IIS 7.5

I am trying to deploy a basic MVC 3 application to my 2008 R2 Server running iis 7.5 but receive a "403 - Forbidden" error trying to view my page.

I have anonymous authentication enabled, and my app pool is using the "ApplicationPoolIdentity" in integrated pipeline mode with .net 4.0. I don't know what "user" the "ApplicationPoolIdentity" is, but I've given IUSR read/write rights to the website folder.

I don't have any other authentication schemes in place, the server is not even running in a domain.

If I put a default html page in there, it loads fine. It's only my methods/controllers that I cannot get to function.

How else can I troubleshoot this?

Thanks,

Community
  • 1
  • 1
Ben Finkel
  • 4,753
  • 7
  • 34
  • 49

3 Answers3

57

Run aspnet_regiis -i. Often I've found you need to do that to get 4.0 apps to work. Open a command prompt:

cd \
cd Windows\Microsoft .NET\Framework\v4.xxx.xxx
aspnet_regiis -i

Once it has installed and registered, make sure you application is using an application pool that is set to .NET 4.0.

Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90
  • 3
    I just found a potential issue with this command. Using -i updated all web applications (pools) to ASP.NET 4.0. Using `aspnet_regiis -ir` installs the version of ASP.NET but does not change any web applications to this version. You may also want to review the -iru option. – Brettski Jul 14 '11 at 16:49
  • Use `aspnet_regiis -iru` to avoid affecting any existing web apps! – Rory Jul 23 '13 at 14:37
  • @Michael Shimmins, don't know how to thanks you, spend half day figuring this out, finally worked, thanks a ton. – foo-baar Aug 27 '14 at 12:13
7

Thanks Micheal for the help.

My OS is 64bit, so I ran aspnet_regiis.exe in Framework64 which solved the problem.

c:\Windows\Microsoft.NET\Framework64\v4.0.30319>

This was after running aspnet_regiis in folder ...\Framework\v4.0.30319 which did not resolve the problem.

robor
  • 2,969
  • 2
  • 31
  • 48
2

Two things to try:

  1. Give permission to the directory in which your website is stored to "Network Services". That's the account that is used for ApplicationPoolIdentity in Server 2008.
  2. If that fails, change ApplicationPoolIdentity to an account for which you have given explicit permissions to your website directory.
Case
  • 1,848
  • 21
  • 32