2014-11-17 1 views
0

내가이Protobuf-NET "바이너리에 대한 검색 매개 변수가없는 생성자 없다"

[DataContract(IsReference = true)] 
    [ProtoContract(SkipConstructor = true)] 
    public class BelgeDosyasi : TablesBase 
    { 
     public BelgeDosyasi() 
     { 


     } 
     [DataMember(Order = 1)] 
     public Binary HizmetBelgeDosya { get; set; } 
     [DataMember(Order = 2)] 
     public string HizmetBelgeUzantisi { get; set; } 
     [DataMember(Order = 3)] 
     public int HizmetBelgeBoyutu { get; set; } 
     [DataMember(Order = 4)] 
     public string HizmetBelgeAdi { get; set; } 
    } 

매우 잘 작동 protobuf없이 데이터베이스에서 바이너리 파일을 다운로드하는이 클래스는 도움이되지만 사용하기 시작 후 우는 소리하는 클래스 protobuf 개체 deserialization에 나는 이진 "에 대한 매개 변수가없는 생성자를 찾을 수 없음"오류가 발생하여 문제를 해결할 수 없습니다. 내 protobuf-net 버전은 버전 = 2.0.0.668입니다. 어떤 도움을 주셔서 감사합니다.

at ProtoBuf.Meta.TypeModel.ThrowCannotCreateInstance(Type type) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:line 1397 
    at proto_8(Object , ProtoReader) 
    at ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read(Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:line 57 
    at ProtoBuf.Meta.RuntimeTypeModel.Deserialize(Int32 key, Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 775 
    at ProtoBuf.ProtoReader.ReadTypedObject(Object value, Int32 key, ProtoReader reader, Type type) in c:\Dev\protobuf-net\protobuf-net\ProtoReader.cs:line 579 
    at ProtoBuf.ProtoReader.ReadObject(Object value, Int32 key, ProtoReader reader) in c:\Dev\protobuf-net\protobuf-net\ProtoReader.cs:line 566 
    at proto_6(Object , ProtoReader) 
    at ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read(Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:line 57 
    at ProtoBuf.Meta.RuntimeTypeModel.Deserialize(Int32 key, Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 775 
    at ProtoBuf.ServiceModel.XmlProtoSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) in c:\Dev\protobuf-net\protobuf-net\ServiceModel\XmlProtoSerializer.cs:line 193 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.PartInfo.ReadObject(XmlDictionaryReader reader, XmlObjectSerializer serializer) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters) 
    at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 



at ProtoBuf.Meta.TypeModel.ThrowCannotCreateInstance(Type type) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:line 1397 
    at proto_8(Object , ProtoReader) 
    at ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read(Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:line 57 
    at ProtoBuf.Meta.RuntimeTypeModel.Deserialize(Int32 key, Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 775 
    at ProtoBuf.ProtoReader.ReadTypedObject(Object value, Int32 key, ProtoReader reader, Type type) in c:\Dev\protobuf-net\protobuf-net\ProtoReader.cs:line 579 
    at ProtoBuf.ProtoReader.ReadObject(Object value, Int32 key, ProtoReader reader) in c:\Dev\protobuf-net\protobuf-net\ProtoReader.cs:line 566 
    at proto_6(Object , ProtoReader) 
    at ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Read(Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:line 57 
    at ProtoBuf.Meta.RuntimeTypeModel.Deserialize(Int32 key, Object value, ProtoReader source) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 775 
    at ProtoBuf.ServiceModel.XmlProtoSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) in c:\Dev\protobuf-net\protobuf-net\ServiceModel\XmlProtoSerializer.cs:line 193 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.PartInfo.ReadObject(XmlDictionaryReader reader, XmlObjectSerializer serializer) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) 
    at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters) 
    at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
+2

이 예에서 '이진'이란 무엇입니까? 이게 너의 타입이야? 또는 EF/some-random-framework/???의 일부 유형 –

+0

친애하는 Marc, 대단히 감사합니다. 그렇습니다. 예외는 Linq.Binary에서 상속받은 av 유형 인 자체가 Binary 유형이라는 것을 알았습니다. Byte []로 변환하면 문제가 해결됩니다. – MuhanadY

답변

0

마크, 당신의 응답을 주셔서 대단히 감사합니다, 그래 난 예외가 유명 타입 바이너리 형식 그것 자체에서 Linq.Binary에서 상속 것을 발견했다. Byte []로 변환하면 문제가 해결됩니다.

관련 문제