Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
添加服务引用时,serilog 似乎无法解构 Visual Studio 自动生成的类(合同消息)。
它们总是用 unknow _typetag 序列化
"fields": { "Request": { "_typeTag": "MessageContractType" } }
为什么它不会自动解构?
这是因为生成的类型有公共字段,而 Serilog 的解构只检查属性。定制IDestructuringPolicy可以实现这一点。
IDestructuringPolicy