I am getting IndexOutOfRangeException at JsonTypeSerializer WriteEnumMember

I am getting IndexOutOfRangeException, See stack trace

{“ResponseStatus”:{“ErrorCode”:“IndexOutOfRangeException”,“Message”:“Index was outside the bounds of the array.”,“StackTrace”:" at ServiceStack.Text.Json.JsonTypeSerializer.WriteEnumMember(TextWriter writer, Object enumValue)\r\n at ServiceStack.Text.Common.WriteType2.WriteProperties(TextWriter writer, Object instance)\r\n at ServiceStack.Text.Common.WriteListsOfElements2.<>c__DisplayClass1_0.<.cctor>b__0(TextWriter writer, Object obj)\r\n at ServiceStack.Text.Common.WriteListsOfElements2.WriteGenericIList(TextWriter writer, IList1 list)\r\n at ServiceStack.Text.Common.WriteListsOfElements2.WriteIList(TextWriter writer, Object oList)\r\n at ServiceStack.Text.Common.WriteType2.WriteProperties(TextWriter writer, Object instance)\r\n at ServiceStack.Text.Common.WriteType`2.WriteProperties(TextWriter writer, Object instance)\r\n at ServiceStack.Text.JsonSerializer.SerializeToStream(Object value, Type type, Stream stream)\r\n at ServiceStack.Text.JsonSerializer.SerializeToStream[T](T value, Stream stream)\r\n at ServiceStack.Serialization.JsonDataContractSerializer.SerializeToStream[T](T obj, Stream stream)\r\n at ServiceStack.Host.ContentTypes.<>c.<.ctor>b__36_0(IRequest r, Object o, Stream s)\r\n at ServiceStack.Host.ContentTypes.<>c__DisplayClass30_0.b__0(IRequest httpReq, Object dto, Stream stream)\r\n at ServiceStack.HttpResponseExtensionsInternal.d__7.MoveNext()"}}

Please provide a repro I can run locally to repro the issue.

Anyway to send the repro privately?

If you have a business license you can send a priority support incident (see your support page).

But really repro’s should be MCVE’s that shouldn’t have any need to contain confidential information. For this it looks like it’d just need an empty class definition with the populated property that causes the Exception, something that you should be able to repro on https://gistlyn.com

Feel free to rename all the class / property names if you have to, it shouldn’t have any effect on reproducing the issue.

Ok, just emailed the repro.

There is a linqpad query that shows the issue.
Data file is data.file, which is binary serialized data which is causing the issue.

Unfortunately I wasn’t able to repro this by just having an empty class. Since the types are very deep it is very hard to mock it.

I’ve not received anything, does your company use an email provider that takes a while before emails are sent?

No, zip file bounced back. Sent again, rename the txt file to zip.

Still nothing. Surprised you need to send a binary at all. Should just a populated class that’s causing the issue.

Also I don’t have LINQ pad, so I’m hoping your repro doesn’t require it.

It doesn’t require LinqPad, sent code as well.