This project is read-only.

FtpClient - Property set method not found in a derived type

Jan 15, 2015 at 7:34 AM
When I made a derived class:
public class MyFtpClient : System.Net.FtpClient.FtpClient
I recieved the error "Property set method not found" on myFtpClient.OpenRead(filePath) - because, it turns out, the base class has a private setter for ClientCertificates:
public X509CertificateCollection ClientCertificates {
            get {
                return m_clientCerts;
            private set {
                m_clientCerts = value;
So in order to enable a fully functioning derived class, I had to edit FtpClient.cs line 621, from:
prop.SetValue(conn, prop.GetValue(this, null), null);
PropertyInfo baseProperty = prop.DeclaringType.GetProperty(prop.Name);
baseProperty.SetValue(conn, prop.GetValue(this, null), null);
Just thought I'd share. Thanks for a great library :)