Closed GoogleCodeExporter closed 9 years ago
Oh, here's the surrogate too, in case it matters:
public class DateTimeOffsetSurrogate
{
public DateTimeOffsetSurrogate(DateTimeOffset dto)
{
Content = dto.ToString("o");
}
public string Content { get; set; }
public static explicit operator DateTimeOffsetSurrogate(DateTimeOffset dto)
{
return new DateTimeOffsetSurrogate(dto);
}
public static explicit operator DateTimeOffset(DateTimeOffsetSurrogate dtos)
{
return DateTimeOffset.Parse(dtos.Content, null, DateTimeStyles.RoundtripKind);
}
}
Original comment by ladene...@gmail.com
on 15 Aug 2011 at 3:20
Hi! I had the same problem and after a while I found a workaround.
I just commented throwing this exception in a source code. See the file
CompilerContext.cs line 648:
I replaced line
if (local == null) throw new InvalidOperationException("Cannot load the address
of a struct at the head of the stack");
with
if (local == null) return;
I ran unittests and all of them passed successfully.
It should be noted that null argument is passed to this method directly in
FiledDecorator.cs line 55
ctx.ReadNullCheckedTail(field.FieldType, Tail, null);
Generally it works for me.
You can use attached patch.
Original comment by nerzhulart
on 24 Nov 2011 at 12:06
Attachments:
Any news on fixing this issue or a work around? Our code makes heavy use of
Nullable<DateTimeOffset> and we would like to use protobuf for serialization.
Original comment by renemygi...@gmail.com
on 9 Jul 2012 at 11:56
r521
Original comment by marc.gravell
on 11 Jul 2012 at 6:34
Original issue reported on code.google.com by
ladene...@gmail.com
on 15 Aug 2011 at 3:19