I was getting an exception trying to serialize a dynamic object… my problem was did not initialize as an expando object… so I found the correct way to do it but I think the exception could be better handled.
dynamic ProfileData = new { XYZ = "XYZ", DEF = "DEF"};
var clearJSON = DynamicJson.Serialize(ProfileData);
`ServiceStack.Text.JsonSerializer.SerializeToString<<>__AnonType0<string,string>>(<>__AnonType0<string,string>)’ is inaccessible due to its protection level