Hi,

I'm using version 4.3, I keep randomly getting this error loading the site via Visual Studio. Has anyone else seen it?

InvalidOperationException: ValueFactory attempted to access the Value property of this instance.

It fails on this line of code in the CookieAuthenticationService.cs
var authenticateResult = _httpContextAccessor.HttpContext.AuthenticateAsync(NopAuthenticationDefaults.AuthenticationScheme).Result;

Usually stopping and restarting the debugger fixes it, but is happening about 50% of the time.


Full Stack:
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)
System.Threading.Tasks.Task.Wait(int millisecondsTimeout, CancellationToken cancellationToken)
System.Threading.Tasks.Task.Wait()
Nop.Services.Authentication.CookieAuthenticationService.GetAuthenticatedCustomer() in CookieAuthenticationService.cs
+
            authenticateResultTask.Wait();
Nop.Web.Framework.WebWorkContext.get_CurrentCustomer() in WebWorkContext.cs
+
                    customer = _authenticationService.GetAuthenticatedCustomer();
Nop.Web.Framework.WebWorkContext.get_WorkingLanguage() in WebWorkContext.cs
+
                var customerLanguageId = _genericAttributeService.GetAttribute<int>(CurrentCustomer,
Nop.Web.Framework.Globalization.CultureMiddleware.SetWorkingCulture(IWebHelper webHelper, IWorkContext workContext) in CultureMiddleware.cs
+
            var culture = new CultureInfo(workContext.WorkingLanguage.LanguageCulture);
Nop.Web.Framework.Globalization.CultureMiddleware.Invoke(HttpContext context, IWebHelper webHelper, IWorkContext workContext) in CultureMiddleware.cs
+
            SetWorkingCulture(webHelper, workContext);
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass4_1.<UseMiddleware>b__2(HttpContext context)
Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Nop.Services.Installation.InstallUrlMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in InstallUrlMiddleware.cs
+
            await _next(context);
Nop.Services.Common.KeepAliveMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in KeepAliveMiddleware.cs
+
            await _next(context);
Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)