I upgraded from 4.0 to 4.3 (of course 4.0 to 4.1 and from 4.1 to 4.2 and from 4.2 to 4.3).
Admin panel is working fine but the public store is giving the following error:
An unhandled exception occurred while processing the request.
InvalidOperationException: Sequence contains no elements
System.Linq.ThrowHelper.ThrowNoElementsException()
Stack
InvalidOperationException: Sequence contains no elements
System.Linq.ThrowHelper.ThrowNoElementsException()
System.Linq.Enumerable.Single<TSource>(IEnumerable<TSource> source)
LinqToDB.Linq.Builder.FirstSingleBuilder+FirstSingleContext+<>c__DisplayClass5_0<T>.<GetSingleElement>b__0(IDataContext db, Expression expr, object[] ps)
LinqToDB.Linq.ExpressionQuery<T>.System.Linq.IQueryProvider.Execute<TResult>(Expression expression)
System.Linq.Queryable.Single<TSource>(IQueryable<TSource> source)
Nop.Services.Customers.CustomerService+<>c__DisplayClass70_0.<GetCustomerAddress>b__5() in CustomerService.cs
Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreate<TItem>(IMemoryCache cache, object key, Func<ICacheEntry, TItem> factory)
Nop.Core.Caching.MemoryCacheManager.Get<T>(CacheKey key, Func<T> acquire) in MemoryCacheManager.cs
Nop.Services.Customers.CustomerService.GetCustomerAddress(int customerId, int addressId) in CustomerService.cs
Nop.Services.Customers.CustomerService.GetCustomerShippingAddress(Customer customer) in CustomerService.cs
Nop.Services.Tax.TaxService.PrepareTaxRateRequest(Product product, int taxCategoryId, Customer customer, decimal price) in TaxService.cs
Nop.Services.Tax.TaxService.GetTaxRate(Product product, int taxCategoryId, Customer customer, decimal price, out decimal taxRate, out bool isTaxable) in TaxService.cs
Nop.Services.Tax.TaxService.GetProductPrice(Product product, int taxCategoryId, decimal price, bool includingTax, Customer customer, bool priceIncludesTax, out decimal taxRate) in TaxService.cs
Nop.Services.Tax.TaxService.GetProductPrice(Product product, decimal price, bool includingTax, Customer customer, out decimal taxRate) in TaxService.cs
Nop.Services.Tax.TaxService.GetProductPrice(Product product, decimal price, Customer customer, out decimal taxRate) in TaxService.cs
Nop.Services.Tax.TaxService.GetProductPrice(Product product, decimal price, out decimal taxRate) in TaxService.cs
Nop.Web.Factories.ProductModelFactory.PrepareSimpleProductOverviewPriceModel(Product product, ProductPriceModel priceModel) in ProductModelFactory.cs
Nop.Web.Factories.ProductModelFactory.PrepareProductOverviewPriceModel(Product product, bool forceRedirectionAfterAddingToCart) in ProductModelFactory.cs
Nop.Web.Factories.ProductModelFactory.PrepareProductOverviewModels(IEnumerable<Product> products, bool preparePriceModel, bool preparePictureModel, Nullable<int> productThumbPictureSize, bool prepareSpecificationAttributes, bool forceRedirectionAfterAddingToCart) in ProductModelFactory.cs
Nop.Web.Components.HomepageProductsViewComponent.Invoke(Nullable<int> productThumbPictureSize) in HomepageProducts.cs
lambda_method(Closure , object , object[] )
Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeSyncCore(ObjectMethodExecutor executor, ViewComponentContext context)
Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsync(ViewComponentContext context)
Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper.InvokeCoreAsync(ViewComponentDescriptor descriptor, object arguments)
AspNetCore.Views_Home_Index.ExecuteAsync() in Index.cshtml
+
@await Component.InvokeAsync("HomepageProducts")
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, Nullable<int> statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
WebMarkupMin.AspNetCore3.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, bool useMinification, bool useCompression)
WebMarkupMin.AspNetCore3.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, bool useMinification, bool useCompression)
WebMarkupMin.AspNetCore3.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in MiniProfilerMiddleware.cs
Nop.Services.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) in AuthenticationMiddleware.cs
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
Nop.Services.Common.KeepAliveMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in KeepAliveMiddleware.cs
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)
Show raw exception details
System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at LinqToDB.Linq.Builder.FirstSingleBuilder.FirstSingleContext.<>c__DisplayClass5_0`1.<GetSingleElement>b__0(IDataContext db, Expression expr, Object[] ps)
at LinqToDB.Linq.ExpressionQuery`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Single[TSource](IQueryable`1 source)
at Nop.Services.Customers.CustomerService.<>c__DisplayClass70_0.<GetCustomerAddress>b__5() in C:\andrei\nop_sources\src\Libraries\Nop.Services\Customers\CustomerService.cs:line 1549
at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreate[TItem](IMemoryCache cache, Object key, Func`2 factory)
at Nop.Core.Caching.MemoryCacheManager.Get[T](CacheKey key, Func`1 acquire) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Caching\MemoryCacheManager.cs:line 79
at Nop.Services.Customers.CustomerService.GetCustomerAddress(Int32 customerId, Int32 addressId) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Customers\CustomerService.cs:line 1549
at Nop.Services.Customers.CustomerService.GetCustomerShippingAddress(Customer customer) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Customers\CustomerService.cs:line 1575
at Nop.Services.Tax.TaxService.PrepareTaxRateRequest(Product product, Int32 taxCategoryId, Customer customer, Decimal price) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 236
at Nop.Services.Tax.TaxService.GetTaxRate(Product product, Int32 taxCategoryId, Customer customer, Decimal price, Decimal& taxRate, Boolean& isTaxable) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 290
at Nop.Services.Tax.TaxService.GetProductPrice(Product product, Int32 taxCategoryId, Decimal price, Boolean includingTax, Customer customer, Boolean priceIncludesTax, Decimal& taxRate) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 407
at Nop.Services.Tax.TaxService.GetProductPrice(Product product, Decimal price, Boolean includingTax, Customer customer, Decimal& taxRate) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 379
at Nop.Services.Tax.TaxService.GetProductPrice(Product product, Decimal price, Customer customer, Decimal& taxRate) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 362
at Nop.Services.Tax.TaxService.GetProductPrice(Product product, Decimal price, Decimal& taxRate) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Tax\TaxService.cs:line 347
at Nop.Web.Factories.ProductModelFactory.PrepareSimpleProductOverviewPriceModel(Product product, ProductPriceModel priceModel) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Factories\ProductModelFactory.cs:line 300
at Nop.Web.Factories.ProductModelFactory.PrepareProductOverviewPriceModel(Product product, Boolean forceRedirectionAfterAddingToCart) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Factories\ProductModelFactory.cs:line 240
at Nop.Web.Factories.ProductModelFactory.PrepareProductOverviewModels(IEnumerable`1 products, Boolean preparePriceModel, Boolean preparePictureModel, Nullable`1 productThumbPictureSize, Boolean prepareSpecificationAttributes, Boolean forceRedirectionAfterAddingToCart) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Factories\ProductModelFactory.cs:line 1115
at Nop.Web.Components.HomepageProductsViewComponent.Invoke(Nullable`1 productThumbPictureSize) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Components\HomepageProducts.cs:line 42
at lambda_method(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeSyncCore(ObjectMethodExecutor executor, ViewComponentContext context)
at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsync(ViewComponentContext context)
at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper.InvokeCoreAsync(ViewComponentDescriptor descriptor, Object arguments)
at AspNetCore.Views_Home_Index.ExecuteAsync() in C:\inetpub\wwwroot\Views\Home\Index.cshtml:line 14
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at WebMarkupMin.AspNetCore3.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
at WebMarkupMin.AspNetCore3.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
at WebMarkupMin.AspNetCore3.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 125
at Nop.Services.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Authentication\AuthenticationMiddleware.cs:line 79
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Nop.Services.Installation.InstallUrlMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Installation\InstallUrlMiddleware.cs:line 53
at Nop.Services.Common.KeepAliveMiddleware.Invoke(HttpContext context, IWebHelper webHelper) in C:\andrei\nop_sources\src\Libraries\Nop.Services\Common\KeepAliveMiddleware.cs:line 50
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)