Broke under .NET, detecting Mono and setting format accordingly. #109

Merged
merged 1 commit into from Apr 9, 2012
View
3 src/ServiceStack.Text/Common/DeserializeType.cs
@@ -158,7 +158,8 @@ private static SetPropertyDelegate GetSetPropertyMethod(TypeConfig typeConfig, P
if (!propertyInfo.CanWrite)
{
//TODO: What string comparison is used in SST?
- var fieldName = string.Format("<{0}>", propertyInfo.Name);
+ string fieldNameFormat = Env.IsMono ? "<{0}>" : "<{0}>i__Field";
+ var fieldName = string.Format(fieldNameFormat, propertyInfo.Name);
var fieldInfos = typeConfig.Type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);
foreach (var f in fieldInfos)
{