0
votes

I have following problem:

there is windows server 2008 r2

it has iis 7.5 installed

I moved my application there (it is asp.net mvc 5 application), installed .net 4.5 framework on the server

ran following command in cmd

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

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

but still it throws exception: 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.

I enabled directory browsing and only thing that it can make is browse through folders. But it is web application and not file directory to browse.

So can anyone tell me what am I missing?

IIS configuration:

enter image description here

UPDATE 1 IUSR and IIS_IUSRS both have full control I also tried adding Everyone with full control on the folder where my application is, but still same

4

4 Answers

1
votes

make sure that the MVC Dll's are included in the build output of your project.

Also try adding this code to the system.webserver part of your web.config

<modules runAllManagedModulesForAllRequests="true">

https://www.iis.net/configreference/system.webserver/modules

<modules runAllManagedModulesForAllRequests="true" /> Meaning

0
votes

If you are trying to test your site by launching http://yourdomain.com/ then it will display all files like you are "Browsing the Directory", you have to add a default document - this is the your main or landing page on your web application settings. On IIS Manager, click your site, on the right pane, under IIS, click Default Document and set the page you want to show first.

0
votes

"403 - Forbidden: Access is denied" means the IIS doesn't have the rights to access the resources in your application folder. It is usually a problem with the user the IIS uses to access the resources.

Just as a test: give "everyone" the full rights to the directory where your application is located. If this works, remove "everyone" and give the user IIS_IUSRS the rights to read the resources on the directory (maybe this user needs rights to write in the App_Data folder).

0
votes

go to published folder of your application and give edit update access to iis user to that folder then it will work, right click on folder click properties and then click on security and then full control to iis user.