Why does Json.NET fail to serialize a X509Certificate2?
问题 Whenever I try to serialize an X509Certificate2 instance with Json.NET (without using its ISerializable implementation, but electing to ignore it), Json.NET throws an exception. The exception message is "A member with the name 'CertContext' already exists on 'System.Security.Cryptography.X509Certificates.X509Certificate2'. Use the JsonPropertyAttribute to specify another name." I wrote a program that reproduces it: using System.Reflection; using System.Security.Cryptography.X509Certificates;