System.MissingFieldException while configurion AutoQueryFeature

Viewed 37

In ServiceStacks "Get Started" page I selected just the "AutoQuery" feature and downloaded the sample project.

In running the project in Visual Studio 2022, an exception is thrown when adding the plugin "AutoQuery Feature":

System.MissingFieldException
  HResult=0x80131511
  Message=Field not found: 'ServiceStack.Configuration.RoleNames.Admin'.
  Source=ServiceStack.Server
  StackTrace:
   at ServiceStack.AutoQueryFeature..ctor()
   at Sample6.ConfigureAutoQuery.<>c.<Configure>b__0_0(ServiceStackHost appHost) in E:\Downloads\Sample6\Sample6\Configure.AutoQuery.cs:line 11
   at ServiceStack.ServiceStackHost.RunManagedAction(Action`1 fn)

Being a quite elementary sample project, I was expecting that it would just run.

What is the cause of this exception?

servicestack sample project with AutoQuery AutoQuery Feature exception

2 Answers

The cause was that the sample project had a wrong dependency.

It was refering ServiceStack.Server 5.* instead of 6.*

Maybe someting must be fixed in the automatic project sample generator.

Related