OrmLite JSON serialization reverts to JSV?

I’m serializing complex objects as JSON in my Sqlite3 db, using this in Startup:

SqliteDialect.Provider.StringSerializer = new JsonStringSerializer();

However, running the same code, occationally it still gets serialized as JSV – same places as previously (and after) it would serialize as JSON. So it’s like sometimes it just decides to do JSV.

My program is too large for a working sample, but is there any chance ServiceStack “forgets” the serializer setting somehow? Is there a better place to set it? Or hint to what I should investigate. I’m running in Visual Studio via debugger, could hot code replacement trigger this (of my own code)?

I don’t see how it wouldn’t use the configured Dialect Provider Serializer unless it’s not using the Dialect Provider. You can try using the BeforeExecFilter to intercept DB commands before they’re executed like printing the generated SQL output which should identify queries with the issue:

OrmLiteUtils.PrintSql();

We would need a stand-alone repro to be able to investigate.