Question

I am working on a new project and am trying to log into the site (it uses forms authentication), but as soon as I log in I get this error.

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

Line 10: 
Line 11:     <div id="partialListOfAuctionsDiv">
Line 12:         @{ Html.RenderAction("PartialListOfAuctions"); }
Line 13:     </div>
Line 14: </fieldset>

The line that is highlighted as the source of the error is

@{ Html.RenderAction("PartialListOfAuctions"); }

I have no idea what this might mean and how to solve it. Any help would be greatly appreciated.

Thanks,

Sachin

Was it helpful?

Solution

It looks as if the ASP.NET process does not have physical access to the web folder. The fact that you can access the site before you are authorized implies that MVC can access the files before then; this implies that its credentials are being changed after you log in. This only happens, I believe, when you have Impersonation turned on. Look for this line in your web.config:

<identity impersonate="true" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top