Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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' #1

Open
harinath2github opened this issue Feb 15, 2023 · 2 comments

Comments

@harinath2github
Copy link

harinath2github commented Feb 15, 2023

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'.

@harinath2github
Copy link
Author

harinath2github commented Feb 15, 2023

2 1-3 1-two

@harinath2github
Copy link
Author

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.<>c__DisplayClass0_0.<.ctor>b__0(MvcViewOptions options)
at Microsoft.Extensions.Options.ConfigureOptions.Configure(TOptions options)
at Microsoft.Extensions.Options.OptionsFactory.Create(String name)
at Microsoft.Extensions.Options.OptionsManager.<>c__DisplayClass5_0.b__0()
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.<>c__DisplayClass1_0.b__0(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.<>c__DisplayClass7_0.b__0(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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant