Does anybody know what is the right way to set up a ProtoContract for an Interface?
I get the following exception \"The type cannot be
Interesting; yes, it looks like something is up there. However, it does work when exposed as a member, i.e.
[ProtoContract]
class Wrapper
{
[ProtoMember(1)]
public ILesson5TestInteface1 Content { get; set; }
}
static class Program
{
static void Main()
{
Wrapper obj = new Wrapper
{
Content = new Lesson5TestClass2()
}, clone;
using(var ms = new MemoryStream())
{
Serializer.Serialize(ms, obj);
ms.Position = 0;
clone = Serializer.Deserialize(ms);
}
// here clone.Content *is* a Lesson5TestClass2 instance
}
}
I will have to look to see what is up with interface support as the root object.