Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

asp.net core - System.BadImageFormatException on running ServiceStack AutoQuery

The Project is running on asp.netcore 3.1.0. I encountered the exception System.BadImageFormatException at ServiceStack.ServiceStackHost. I just can't get AutoQuery working.

the stack trace is below

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)
   at ServiceStack.ServiceStackHost.OnStartupException(Exception ex) in C:BuildAgentwork3481147c480f4a2fsrcServiceStackServiceStackHost.cs:line 673
   at ServiceStack.ServiceStackHost.RunPostInitPlugin(Object instance) in C:BuildAgentwork3481147c480f4a2fsrcServiceStackServiceStackHost.cs:line 870
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at ServiceStack.ServiceStackHost.AfterPluginsLoaded(String specifiedContentType) in C:BuildAgentwork3481147c480f4a2fsrcServiceStackServiceStackHost.cs:line 901
   at ServiceStack.ServiceStackHost.OnAfterInit() in C:BuildAgentwork3481147c480f4a2fsrcServiceStackServiceStackHost.cs:line 792
   at ServiceStack.ServiceStackHost.Init() in C:BuildAgentwork3481147c480f4a2fsrcServiceStackServiceStackHost.cs:line 296
   at ServiceStack.NetCoreAppHostExtensions.UseServiceStack(IApplicationBuilder app, AppHostBase appHost) in C:BuildAgentwork3481147c480f4a2fsrcServiceStackAppHostBase.NetCore.cs:line 281
   at Revopos.Api.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, DatabaseContext dbContext) in C:
epos
etcoreRevoposRevopos.ApiStartup.cs:line 182
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__2(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Sentry.AspNetCore.SentryStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder e)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)

below is my AppHost codes

enter image description here

code in Startup Configure

question from:https://stackoverflow.com/questions/65918193/system-badimageformatexception-on-running-servicestack-autoquery

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...