Cant navigate to different directories in sftp server using SSH.NET
I am trying to make code that will navigate throughout my sftp server using SSH.NET library, and I'm having trouble with the navigation. They have a built in way of changing the current working directory with
client.ChangeDirectory
, and you can access the directory with client.WorkingDirectory. However, this doesn't seem to do anything at all when I use it. Even though I change the workign directory, and I see the string change, when I do "pwd" in ssh to access the current directory, it is always the root no matter what.
The second method to navigate would be to just use cd in ssh, using cSSH.RunCommand("cd ..."). However, this has the same issue where it doesn't seem to change the directory at all. Not sure why, but none of these methods work. I've been trying for a long time now but cant seem to figure out why. Thanks.14 Replies
and just to be clear, this problem is only happening in my C# code, when i connect using my terminal this does not happen
curious
to me this works
maybe you can compare with another tool, even if only using plink/sftp by Process.Start
i can change the working directory just fine, cause in the yellow i am not at root anymore. but the problem is that when i do dotnet run -r roslyn, it says there is no csproj in the directory
which is not true because, in that directory, there is a .csproj
hmmm strange; did you try also setting explicitely the
--project
path?yea
i tried
dotnet run -r roslyn --project DIVisualizer.Server.csproj
and still the same project cant be found errorno i mean
dotnet ... --project /root/di-visualizer/DIVisualizer.Server
no
ill try that
ok thanks that worked, i did, dotnet run -r roslyn --project /root/di-visualizer/DIVisualizer.Server/DIVisualizer.Server.csproj
it remains to understand why WorkingDirectory doesn't do what it's supposed to do
oh ok
ill look into it some more tomorrow, to be honest i dont even think i want to run roslyn like that, i was just trying stuff out
Roslynator | My Docs
Roslynator is a set of code analysis tools for C#, powered by Roslyn.
i found this and i was gonna look through it to see what i actually want to do