ASP.NET Core从2.0升级到2.1-TypeLoadException并引用了“ System.Private.CoreLib”

时间:2018-08-20 07:46:20

标签: c# asp.net-core

我已经在这里浏览了Microsoft的.NET Core 2.0至2.1更新:https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1

大多数应用程序可以正常运行和启动,并且可以在各个屏幕上进行浏览。问题出在我尝试POST并更新时,似乎是模型绑定器……也许吗?

  

TypeLoadException:通用类型“ System.Func`2”在程序集“ System.Private.CoreLib,版本= 4.0.0.0,文化=中性,PublicKeyToken = 7cec85d7bea7798e”中使用了无效的实例化。

如何找到导致此问题的组件?堆栈跟踪没有提供任何详细信息...可能是另一个NuGet软件包吗?

完整的堆栈跟踪为:

  

System.RuntimeType.MakeGenericType(Type []实例化)   Microsoft.Extensions.Internal.PropertyHelper.MakeFastPropertyGetter(Type openGenericDelegateType,MethodInfo propertyGetMethod,MethodInfo openGenericWrapperMethod)   Microsoft.Extensions.Internal.PropertyHelper.MakeFastPropertyGetter(PropertyInfo propertyInfo,MethodInfo propertyGetterWrapperMethod,MethodInfo propertyGetterByRefWrapperMethod)   Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreatePropertyDetails(ModelMetadataIdentity键)   Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.GetMetadataForProperties(Type modelType)   Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata.get_Properties()   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreCached(DefaultModelBinderProviderContext providerContext,对象令牌)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据,BindingInfo bindingInfo)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory + DefaultModelBinderProviderContext.CreateBinder(ModelMetadata元数据)   Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider.GetBinder(ModelBinderProviderContext上下文)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinderCoreUncached(DefaultModelBinderProviderContext providerContext,对象标记)   Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory.CreateBinder(ModelBinderFactoryContext上下文)   Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.GetParameterBindingInfo(IModelBinderFactory modelBinderFactory,IModelMetadataProvider modelMetadataProvider,ControllerActionDescriptor actionDescriptor,MvcOptions mvcOptions)   Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.CreateBinderDelegate(ParameterBinder parameterBinder,IModelBinderFactory modelBinderFactory,IModelMetadataProvider modelMetadataProvider,ControllerActionDescriptor actionDescriptor,MvcOptions mvcOptions)   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache.GetCachedResult(ControllerContext controllerContext)   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerProvider.OnProvidersExecuting(ActionInvokerProviderContext上下文)   Microsoft.AspNetCore.Mvc.Internal.ActionInvokerFactory.CreateInvoker(ActionContext actionContext)   Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandler + <> c__DisplayClass8_0.b__0(HttpContext c)   Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)   Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext上下文)   Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)   Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)   Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext上下文)

0 个答案:

没有答案