djanosik / Moon.AspNetCore

Extensions for ASP.NET Core framework
MIT License
3 stars 0 forks source link

upgrade 2.1 to 3.1 - Could not load type 'Microsoft.AspNetCore.Mvc.DataAnnotations.Internal.NumericClientModelValidatorProvider' from assembly 'Microsoft.AspNetCore.Mvc.DataAnnotations, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' #3

Open harinath2github opened 1 year ago

harinath2github commented 1 year ago

Hi Team,

We recently started migrating our web app from core 2.1 to 3.1, but running into below error.

We know the last and latest version of Microsoft.AspNetCore.Mvc.DataAnnotations is 2.2.0

but after migrating our app from 2.1 to 3.1, we resolved all the issues, but below issue is coming all the time...

i tried all the options... nothing working out... pls help us here and resolve this. We been trying to fix this quite long time.

Could not load type 'Microsoft.AspNetCore.Mvc.DataAnnotations.Internal.NumericClientModelValidatorProvider' from assembly 'Microsoft.AspNetCore.Mvc.DataAnnotations, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. 2 1-3 1-two

harinath2github commented 1 year ago

System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.DataAnnotations.Internal.NumericClientModelValidatorProvider' from assembly 'Microsoft.AspNetCore.Mvc.DataAnnotations, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. at Moon.AspNetCore.Validation.MoonValidationMvcViewOptionsSetup.Configure(MvcViewOptions options, IServiceProvider serviceProvider) at Moon.AspNetCore.Validation.MoonValidationMvcViewOptionsSetup.<>cDisplayClass0_0.<.ctor>b0(MvcViewOptions options) at Microsoft.Extensions.Options.ConfigureOptions.Configure(TOptions options) at Microsoft.Extensions.Options.OptionsFactory.Create(String name) at Microsoft.Extensions.Options.OptionsManager.<>cDisplayClass5_0.b0() at System.Lazy.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy.CreateValue() at System.Lazy.get_Value() at Microsoft.Extensions.Options.OptionsCache.GetOrAdd(String name, Func createOptions) at Microsoft.Extensions.Options.OptionsManager.Get(String name) at Microsoft.Extensions.Options.OptionsManager.get_Value() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvokerProvider..ctor(PageLoader loader, IPageFactoryProvider pageFactoryProvider, IPageModelFactoryProvider modelFactoryProvider, IRazorPageFactoryProvider razorPageFactoryProvider, IActionDescriptorCollectionProvider collectionProvider, IEnumerable filterProviders, ParameterBinder parameterBinder, IModelMetadataProvider modelMetadataProvider, IModelBinderFactory modelBinderFactory, ITempDataDictionaryFactory tempDataFactory, IOptions mvcOptions, IOptions mvcViewOptions, IPageHandlerMethodSelector selector, DiagnosticListener diagnosticListener, ILoggerFactory loggerFactory, IActionResultTypeMapper mapper, IActionContextAccessor actionContextAccessor) at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitNoCache(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<T1,T2>.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>cDisplayClass1_0.b0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider) at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointFactory.<>cDisplayClass7_0.b0(HttpContext context) at async Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.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 StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 105 at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.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.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at StackExchange.Exceptional.ExceptionalMiddleware.Invoke(HttpContext context)

Full Trace:

at StackExchange.Exceptional.ExceptionalMiddleware.Invoke(HttpContext context) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(TStateMachine& stateMachine) at StackExchange.Exceptional.ExceptionalMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Mvc.Versioning.ApiVersioningMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Hosting.HostingApplication.ProcessRequestAsync(Context context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT.ProcessRequestAsync() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(TStateMachine& stateMachine) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT.ProcessRequestAsync() at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(TStateMachine& stateMachine) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest() at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

harinath2github commented 1 year ago

team, pls help me here...