Is this a 3rd party plugin or one of your own?
My own custom plugindavidandrewpowell wrote:
If it is your own plugin (and whilst not ideal) could you not rename the plugin assembly to be Nop.Plugin.[Group].[Name] to work around the issue?
My plugin assembly name like DemoNop.Plugin.Widgets.NivoSlider (I have tried with change defult NivoSlider slider plugin for testing purpose)davidandrewpowell wrote:
It does sound like an issue though. If nopcommerce allows you register plugins with any name then it should also register the validation in those plugins.
I don't think nopCommerce 4.20 is suport with my assembly name. davidandrewpowell wrote:
What is the code that you have added in your own INopStartup that is not working correctly and are you sure that it is getting executed?
Here is code
//add fluent validation
//register all available validators from Nop assemblies
var assemblies = services.AddNopMvc().PartManager.ApplicationParts
.Where(part => part.Name.StartsWith("DemoNop", StringComparison.InvariantCultureIgnoreCase))
.Select(part => part.Assembly);
//implicit/automatic validation of child properties
x.ImplicitlyValidateChildProperties = true;
I am getting error during run application:
InvalidOperationException: Sequence contains more than one matching element
System.Linq.Enumerable.SingleOrDefault<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate)
DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IObjectModelValidator (DelegateActivator), Services = [Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IObjectModelValidator], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Sequence contains more than one matching element (See inner exception for details.)