Error After deploying nopcommerce 4.5 on IIS

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
After deploying nopcommerce 4.5 on IIS and installing. I am getting this error in event viewer : (everything has been working fine locally for weeks and is working now as well so cannot figure out why its not running on the server)

Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: e7cdb35b17d08713
TraceId: 553bdc4d168a8cf083f90dcd1a70fb0e
ParentId: 0000000000000000
RequestId: 8000002d-0007-fb00-b63f-84710c7967bb
RequestPath: /install

An unhandled exception has occurred while executing the request.

Exception:
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Nop.Web.Controllers.InstallController.
---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Nop.Web.Controllers.InstallController' can be invoked with the available services and parameters:
Cannot resolve parameter 'System.Lazy`1[Nop.Services.Installation.IInstallationService] installationService' of constructor 'Void .ctor(Nop.Core.Configuration.AppSettings, System.Lazy`1[Nop.Web.Infrastructure.Installation.IInstallationLocalizationService], System.Lazy`1[Nop.Services.Installation.IInstallationService], Nop.Core.Infrastructure.INopFileProvider, System.Lazy`1[Nop.Services.Security.IPermissionService], System.Lazy`1[Nop.Services.Plugins.IPluginService], System.Lazy`1[Nop.Core.Caching.IStaticCacheManager], System.Lazy`1[Nop.Services.Plugins.IUploadService], System.Lazy`1[Nop.Core.IWebHelper], System.Lazy`1[Nop.Services.Common.NopHttpClient])'.
   at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Activators.Reflection.ReflectionActivator.<ConfigurePipeline>b__11_0(ResolveRequestContext ctxt, Action`1 next)
   at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
   at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_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 ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   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 Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Nop.Services.Authentication.AuthenticationMiddleware.InvokeAsync(HttpContext context) in E:\Websites\Carparts247\src\Libraries\Nop.Services\Authentication\AuthenticationMiddleware.cs:line 94
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 121
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
   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.InvokeAsync(HttpContext context, IWebHelper webHelper) in E:\Websites\Carparts247\src\Libraries\Nop.Services\Installation\InstallUrlMiddleware.cs:line 53
   at Nop.Services.Common.KeepAliveMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper) in E:\Websites\Carparts247\src\Libraries\Nop.Services\Common\KeepAliveMiddleware.cs:line 50
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   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.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
1 year ago
ehsankayani wrote:
After deploying nopcommerce 4.5 on IIS and installing. I am getting this error in event viewer : (everything has been working fine locally for weeks and is working now as well so cannot figure out why its not running on the server)


Have you have customised the source code ?
When you saying running fine - you mean in Visual Studio or on a local IIS ?

Now you are running the install on the Production Server and getting the error
or Did the install complete and now you are getting the error ?

BTW no need to start a new post for the same issue
See https://www.nopcommerce.com/en/boards/topic/96273/error-after-installing-nopcommer-45-on-iis
1 year ago
I have customized code YES. And it installed then started thowring error now running fine. So  i installed again so lets see.
1 year ago
SO its working fine but as soon as I changed Dbname in connectino string and restarted application its back to : ERR_TOO_MANY_REDIRECTS
1 year ago
So all works now but again I have to redo all the product addition / categories again?  Because when I change the name of database to older one in appdata\\appsettings . It breaks  and I start getting :

ERR_TOO_MANY_REDIRECTS
1 year ago
Do you have an SSL Certificate and No SSL Selected in store setting
or the opposite no SSL Certificate and SSL Turned on
Check that the settings align
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.