Server Error in '/' Application.

Access to the path 'E:\Vhosts\sextoys-aanbiedingen.nl\httpdocs\App_Data\ShoppingCarts\36af0289-3e5e-4018-8013-c0aa6daae622.cart' is denied.

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 to the path 'E:\Vhosts\sextoys-aanbiedingen.nl\httpdocs\App_Data\ShoppingCarts\36af0289-3e5e-4018-8013-c0aa6daae622.cart' is denied.

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: Access to the path 'E:\Vhosts\sextoys-aanbiedingen.nl\httpdocs\App_Data\ShoppingCarts\36af0289-3e5e-4018-8013-c0aa6daae622.cart' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +435
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1242
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +146
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +126
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +105
   System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) +83
   SextoysAanbiedingenMvcApplication.Models.ShoppingCart.SaveAs(String fileName) in C:\Data\Projects\Sextoys-Aanbiedingen-2\Sextoys Aanbiedingen 2.0\SextoysAanbiedingenMvcApplication\Models\ShoppingCart.cs:109
   SextoysAanbiedingenMvcApplication.Controllers.ShoppingCartController.Add(String id, String variant, Int32 quantity) in C:\Data\Projects\Sextoys-Aanbiedingen-2\Sextoys Aanbiedingen 2.0\SextoysAanbiedingenMvcApplication\Controllers\ShoppingCartController.cs:244
   lambda_method(Closure , ControllerBase , Object[] ) +243
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +280
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +80
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +466
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +659
   System.Web.Mvc.Controller.ExecuteCore() +147
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +60
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +25
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +60
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +431
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158


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