Service cannot return Value Types for its Service Responses?

I have defined the below.

public class WxMessage_YB : IReturn<bool>, IGet
public bool Any(WxMessage_YB request)
     ... return false;
     ... return true;

When I used the method, it will get a error , detail in the below picture.

 await Gateway.SendAsync(new WxMessage_YB());

my current servicestack version is 4.5.13, Is there any changed in these version? it works fine in the before version.

Like the error message says you can’t return a value type, you can return either a string like “true”, “1”, raw byte[] or ideally a Typed Response DTO.

Thanks, I have found in HostContext.StrictMode = true, Is not allowed return a value type .

Because it’s trying to save you from interoperability issues from trying to use Value Types as Service Responses (i.e. they wont work in some Native Languages). It’s highly recommended (i.e known to fail) to follow StrictMode guidelines and only return reference types, i.e. wrap the boolean in a string if you need to.