403 - Forbidden: Access is denied. ASP.Net MVC

asp.net Mvc

asp.net Mvc Problem Overview


> Possible Duplicate:
> ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden

I published my application on server. When I enter my domain i got this error:

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

What's happend?

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

Are you hosting the site on iis? if so make sure the account your website runs under has access to local file system?

Straight from msdn .....

> The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. This means that an ASP.NET application deployed inside the root folder already has Read and Execute permissions to its application folders. However, if your ASP.NET application needs to use files or folders in other locations, you must specifically enable access.

To provide access to an ASP.NET application running as Network Service, you must grant access to the Network Service account.

To grant read, write, and modify permissions to a specific file

  • In Windows Explorer, locate and select the required file.
  • Right-click the file, and then click Properties.
  • In the Properties dialog box, click the Security tab.
  • On the Security tab, examine the list of users. If the Network Service
  • account is not listed, add it.
  • In the Properties dialog box, click the Network Service user name, and in the Permissions for NETWORK SERVICE section, select the Read, Write, and Modify permissions.
  • Click Apply, and then click OK.

Click here for more

Solution 2 - asp.net Mvc

In addition to the answers above, you may also get that error when you have Windows Authenticaton set and :

  • IIS is pointing to an empty folder.
  • You do not have a default document set.

Solution 3 - asp.net Mvc

I just had this issue, it was because the IIS site was pointing at the wrong Application Pool.

Solution 4 - asp.net Mvc

I had the same issue (on windows server 2003), check in the IIS console if you have allowed ASP.NET v4 service extension (under IIS / ComputerName / Web Service extensions)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAliView Question on Stackoverflow
Solution 1 - asp.net Mvcalmog.oriView Answer on Stackoverflow
Solution 2 - asp.net MvcrobastaView Answer on Stackoverflow
Solution 3 - asp.net MvcRickView Answer on Stackoverflow
Solution 4 - asp.net MvcPetrView Answer on Stackoverflow