SftpClient.Create thows SshException instead of SftpPathNotFoundException when directories don't exist
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 993
- Merge medio
- 9g 21h
- PR unite (30g)
- 1
Descrizione
SftpClient.Create documentation states it throws SftpPathNotFoundException if
The specified path is invalid, or its directory was not found on the remote host.
However, when I try to create a file at an non-existing path I get SshException with "Folder not found" message with stack trace starting at SftpSession.RequestOpen. Not only this is confusing and doesn't match documented behavior, but also SshException is too generic to handle this particular case (e.g. create the directory and try again).
Below is the content of the response object:

Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il fallimento tramite SftpClient.Create con una directory remota mancante, quindi traccia lo stack a partire da SftpSession.RequestOpen. Confronta la SshException osservata con il comportamento documentato di SftpPathNotFoundException; il lavoro è completo quando il caso della directory mancante produce l'eccezione specifica documentata e la copertura della regressione lo verifica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100