我正在尝试反序列化作为集合的对象。集合中包含的类是从基类继承的类。
Public MustInherit Class EntityBase
Protected Sub New()
Initialize()
End Sub
End Class
Partial Public Class [BarEntity]
Inherits EntityBase
Public Sub New()
MyBase.New()
End Sub
End Class
在这种情况下,集合包含 BarEntity 类。但是当时我像这样在protobuf-net中调用反序列化器
Dim byteafter() As Byte = Convert.FromBase64String(CType(oWSResult.Obj, String))
Dim ms As New MemoryStream(byteafter)
myList = Serializer.Deserialize(Of BarEntityCollection)(ms)
正在抛出这个No parameterless constructor found for EntityBase
此代码正在 Compact Framework 3.5 应用程序中执行。
任何帮助将不胜感激。谢谢。