Server Error in '/pub' Application.

Attempted to perform an unauthorized operation.

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: Attempted to perform an unauthorized operation.

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 File 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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[UnauthorizedAccessException: Attempted to perform an unauthorized operation.]
   HousingBenefit.Web.Controllers.AdminAccountController..ctor() in C:\agent_rnd\_work\1\s\HousingBenefit.Solution\HousingBenefit.Web\Controllers\AdminAccountController.cs:26
   lambda_method(Closure , IBuilderContext ) +226
   Unity.ObjectBuilder.BuildPlan.DynamicMethod.<>c__DisplayClass16_0.<GetBuildMethod>b__0(IBuilderContext context) +35
   Unity.Strategies.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +624
   Unity.UnityContainer.ThrowingBuildUp(IBuilderContext context) +136

[ResolutionFailedException: Resolution of the dependency failed, type = 'HousingBenefit.Web.Controllers.AdminAccountController', name = '(none)'.
Exception occurred while: Calling constructor HousingBenefit.Web.Controllers.AdminAccountController().
Exception is: UnauthorizedAccessException - Attempted to perform an unauthorized operation.
-----------------------------------------------
At the time of the exception, the container was: 
  Resolving HousingBenefit.Web.Controllers.AdminAccountController,(none)
  Calling constructor HousingBenefit.Web.Controllers.AdminAccountController()
]
   Unity.UnityContainer.ThrowingBuildUp(IBuilderContext context) +485
   HousingBenefit.Web.DependencyResolverSpy.GetService(Type serviceType) in C:\agent_rnd\_work\1\s\HousingBenefit.Solution\HousingBenefit.Web\App_Start\DIConfig.cs:202
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +61

[InvalidOperationException: An error occurred when trying to create a controller of type 'HousingBenefit.Web.Controllers.AdminAccountController'. Make sure that the controller has a parameterless public constructor.]
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +242
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +262
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +77
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1020
   System.Web.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0() +35
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +143
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0