How can I serialize a third-party type using protobuf-net or other serializers?

I have List<HtmlAgilityPack.HtmlNode>, but protobuf-net gives me the error that it does not have a contract. How can I specify a contract for him when I have no source? He actually said that he cannot deduce a type, but I guess because I did not use its attibute, right?

The binary serializer also complains by default because the type is not marked as serializable.

EDIT: error message:

Type is not expected, and no contract can be inferred: HtmlAgilityPack.HtmlNode
+3
source share
2 answers

, HTML ... html - ! , :

protobuf-net v2 TypeModel , , ( v2 , ). , - , , . - RuntimeTypeModel.Default, MetaType ( ). , (/), , .. .

, "", DTO ( ) DTO.

: , Serializer.*. , TypeModel /, .

HTML-agility-pack, , protobuf-net.

+5

All Articles