FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

Minor issue with FtpProfile.ToCode()

Open MarkBlaise opened this issue 7 months ago • 3 comments

FTP Server OS: Windows 2016 / 2019 - IIS 10.0 FTP Server Type: Unknown FluentFTP Version: FluentFTP 54.1.1.0(.NET 8.0+) Client Computer OS: Windows 11, running VS 2022 17.14.31 (April 2026) Framework: .NET 9, Maui App Target: Android 15, both emulator and phone device (Galaxy S25)

First off, thanks for a solid, full-featured FTP client!.

I found a very minor problem with the code emitted by FtpProfile.ToCode(). The profile returned by a successful call to AsyncFtpClient.AutoConnect(), emitted the following via ToCode():

client.LoadProfile(new FtpProfile {
    Host = "host",
    Credentials = new NetworkCredential("user", "pwd"),
    Encryption = FtpEncryptionMode.Auto,
    Protocols = SslProtocols.Tls12, 
    DataConnection = FtpDataConnectionType.PASV,
    Encoding = System.Text.UTF8Encoding,
});

That last line should be:

Encoding = System.Text.UTF8Encoding.UTF8,

Thanks!

MarkBlaise avatar May 01 '26 22:05 MarkBlaise

Isn't "System.Text.UTF8Encoding.UTF8" exactly what you get when you use the equivalent "System.Text.UTF8Encoding"?

FanDjango avatar May 02 '26 19:05 FanDjango

Yes agreed. I get this error 'UTF8Encoding' is a type, which is not valid in the given context

Image

robinrodricks avatar May 03 '26 19:05 robinrodricks

Should be fixed in 54.1.2 https://www.nuget.org/packages/FluentFTP/54.1.2

robinrodricks avatar May 03 '26 19:05 robinrodricks