Binu Thayamkery - 186 - Jan 26, 2015

I am getting this error: {“responseStatus”:{“errorCode”:“TypeInitializationException”,“message”:“Thetypeinitializerfor’ServiceStack.Text.Common.WriteListsOfElements`2’threwanexception.”}}

It throws an Http500, in the response stream (json) you can see truncated response and this error concatenated to it. 

Our site is hosted in Azure. Strangely everything works great in localhost (to make life more interesting :slight_smile:

This started with a new code update, but there was no significant code change related to this particular api end point - other change that happened was our SQL Azure was updated to a standard from business web edition. (When I got error I rolled back and old code runs just fine with this SQL edition)

Any clues, pointers appreciated.


Can’t really help identify the issue without being able to repro it. Are you trying to serialize an EF model or some non POCO? What’s the Model look like that this error’s happening on?

Binu Thayamkery:

I narrowed it down to a simple POCO - this has a field with [AllowHtml] attribute. This seems to be the offending one. I removed the attribute, it works! But what is concerning is that this was there all along !!!