Skip to content

FtpWebRequest method "ListDirectoryDetails" returns broken result for encrypted connetion #134130

Description

@WolfgangHG

Description

This is a regression in .NET10: I use FtpWebRequest with Method = WebRequestMethods.Ftp.ListDirectoryDetails to return a directory listing.

I read the response like this:

FtpWebResponse response = (FtpWebResponse)webRequest.GetResponse();
using StreamReader reader = new StreamReader(response.GetResponseStream());
string response = reader.ReadToEnd();

With .NET9, this returns this:

07-08-24  11:04AM       <DIR>          subdir1
04-29-22  10:55AM       <DIR>          subdir2
04-29-22  10:54AM                12037 file1.png
07-01-22  01:31PM             10981859 file2.xml

.NET 10 returns some garbage - I post a screenshot of the string content from debugger:

Image

Reproduction Steps

Attached is a sample: FtpTest.zip

It contains two target frameworks ("net9.0-windows" and "net10.0-windows"), so launch it with both to compare the results.

In the sample, enter FTP server address, login and password and set the checkbox "Encrypt connetion".
Image
Then click "Directory listing".
This should work with .NET9, but show a broken response with .NET10.

Expected behavior

.NET10 should report a plain text listing identical to .NET9.

Actual behavior

See description.

Regression?

.NET9.

Known Workarounds

Use FluentFtp - my sample also provides this.

Configuration

No response

Other information

No response

Activity

  1. changed the title [-]FtpWebRequest Method "ListDirectoryDetails" returns broken result for encrypted connetion[/-] [+]FtpWebRequest method "ListDirectoryDetails" returns broken result for encrypted connetion[/+] on Sep 17, 2026
  2. dotnet-policy-service commented on Sep 17, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  3. MihuBot commented on Sep 17, 2026

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  4. WolfgangHG commented on Sep 17, 2026

    @WolfgangHG
    Author

    The bot is right, dotnet/sdk#52324 is the same issue. But I will keep this one open, as I think the "runtime" repo is the proper place to report this.

    I found another issue about regressions in .NET 10 FTP upload, where the broken output is mentioned in comment #123135 (comment). Part of issue #123135 seems to have been fixed in .NET11: #123234, but this fix probably does not handle the broken output.

  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Oct 1, 2026
  6. added this to the 12.0.0 milestone on Oct 1, 2026
  7. wfurt commented on Oct 2, 2026

    @wfurt
    Member

    I tried to reproduce it @WolfgangHG and not seems like #123234 resolves it as well. please give it shot with .NET 11 RC1+ and share the outcome.

  8. added
    needs-author-actionAn issue or pull request that requires more info or actions from the author.
    on Oct 2, 2026
  9. dotnet-policy-service commented on Oct 2, 2026

    @dotnet-policy-service
    Contributor

    This issue has been marked needs-author-action and may be missing some important information.

  10. WolfgangHG commented on Oct 3, 2026

    @WolfgangHG
    Author

    I can confirm that it works in .NET11 RC1: both the broken result string and the random ObjectDisposedException are fixed.

    Closing this issue. A backport to .NET10 would be nice, but we already worked around it by adding FluentFtp support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Netneeds-author-actionAn issue or pull request that requires more info or actions from the author.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions