无法加载类型'Microsoft.AspNetCore.Mvc.Internal.IActionSelectorDecisionTreeProvider'

时间:2017-11-05 01:14:52

标签: c# asp.net-core asp.net-core-mvc visual-studio-2017 odata

我正在尝试构建AutoOdataEF项目但收效甚微。

我遇到以下异常:

  

Generated.OData.EF.API>应用启动异常:   System.TypeLoadException:无法加载类型   'Microsoft.AspNetCore.Mvc.Internal.IActionSelectorDecisionTreeProvider'   来自程序集'Microsoft.AspNetCore.Mvc.Core,Version = 2.0.0.0,   Culture = neutral,PublicKeyToken = adb9793829ddae60'。   Generated.OData.EF.API>在System.Signature.GetSignature(Void *   pCorSig,Int32 cCorSig,RuntimeFieldHandleInternal fieldHandle,   IRuntimeMethodInfo methodHandle,RuntimeType declaringType)   Generated.OData.EF.API>在   System.Signature..ctor(IRuntimeMethodInfo methodHandle,RuntimeType   declaringType)Generated.OData.EF.API>在   System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()   Generated.OData.EF.API>在   System.Reflection.RuntimeConstructorInfo.GetParameters()   Generated.OData.EF.API>在   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(类型   serviceType,Type implementationType,ISet 1 callSiteChain) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, ISet 1 callSiteChain)   Generated.OData.EF.API>在   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(类型   serviceType,ISet 1 callSiteChain) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, ISet 1 callSiteChain)Generated.OData.EF.API>在   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(类型   serviceType,Type implementationType,ISet 1 callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(Type serviceType, Type implementationType, ISet 1 callSiteChain)   Generated.OData.EF.API>在   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor   descriptor,Type serviceType,ISet 1 callSiteChain) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, ISet 1 callSiteChain)Generated.OData.EF.API>在   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(类型   serviceType,ISet 1 callSiteChain) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType, ServiceProvider serviceProvider) Generated.OData.EF.API> at System.Collections.Concurrent.ConcurrentDictionaryExtensions.GetOrAdd[TKey,TValue,TArg](ConcurrentDictionary 2   字典,TKey密钥,Func 3 valueFactory, TArg arg) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) Generated.OData.EF.API> at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) Generated.OData.EF.API> at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action 1 configureRoutes)Generated.OData.EF.API>在   Autogenerated.OData.Api.ODataEfApiGeneratorExtensions.UseODataEFGenerator(IApplicationBuilder   app)Generated.OData.EF.API>在   Generated.OData.EF.API.Startup.Configure(IApplicationBuilder app,   IHostingEnvironment env,ILoggerFactory loggerFactory)   Generated.OData.EF.API> ---从先前位置开始的堆栈跟踪结束   抛出异常的地方--- Generated.OData.EF.API>在   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()   Generated.OData.EF.API>在   Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder   app)Generated.OData.EF.API>在   Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter<> c__DisplayClass0_0.b__0(IApplicationBuilder   app)Generated.OData.EF.API>在   Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter<> c__DisplayClass3_0.b__0(IApplicationBuilder   app)Generated.OData.EF.API>在   Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter<> c__DisplayClass0_0.b__0(IApplicationBuilder   Builder)Generated.OData.EF.API>在   Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()   Generated.OData.EF.API>暴击:   Microsoft.AspNetCore.Hosting.Internal.Web

我能够成功完成以下步骤:

  

克隆回购/下载zip打开OData-EF-APIGenerator解决方案   根据需要还原包构建解决方案打开nuget   包管理器控制台,确保将默认项目设置为   EF.Example,并执行Update-Database,它将构建和播种   最初的SQL Express数据库。如果您有SQL服务器而不是SQL   表达,只需修改EF.Example项目中的连接字符串

我在最后一步失败了:

Press F5, which should start the Generated.OData.EF.API project

enter image description here

出错了什么?如何构建它?

我已经压缩了整个解决方案here,包括包。

0 个答案:

没有答案