Deployment fails beucase of SCP-Error
While deploying an error is thrown. Seems like a problem with SshNet?
2019-05-15 09:09:44.0888|INFO|VSMonoDebugger.Services.NLogService|===== DeployAndRunCommandOverSSH =====
2019-05-15 09:09:44.0988|INFO|MonoVisualStudioExtension|BuildProject C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\LinuxCanTest.csproj Debug
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|### CollectOutputDirectories: Propertes of project 'LinuxCanTest'
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|OutputFullPath = C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug\
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\LinuxCanTest.csproj - OutputDir: C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug\
2019-05-15 09:09:44.1677|TRACE|VSMonoDebugger.Services.NLogService|Entering: StartDebuggerAsync - SSHDebugger.cs(35)
2019-05-15 09:09:44.1677|INFO|VSMonoDebugger.Services.NLogService|StartDebuggerAsync - deploy
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetRegistryRoot - XamarinEngine.cs(220)
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetLocale - XamarinEngine.cs(214)
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: LaunchSuspended - XamarinEngine.cs(112)
2019-05-15 09:10:15.7013|TRACE|VSMonoDebugger.Services.NLogService|Entering: SerializeDebuggerOptions - XamarinEngine.cs(34)
2019-05-15 09:10:16.0281|TRACE|VSMonoDebugger.Services.NLogService|Entering: ResumeProcess - XamarinEngine.cs(126)
2019-05-15 09:10:16.0281|TRACE|VSMonoDebugger.Services.NLogService|Entering: Attach - XamarinEngine.cs(154)
2019-05-15 09:10:16.0281|ERROR|VSMonoDebugger.Services.NLogService|System.Exception: SSHDebugger: scp: error: unexpected filename:
Executed steps:
SSH Login: [email protected]:22 Directory: /home/fiege/MonoDebugTemp/
SSH: Start deployment from 'C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug' to '/home/fiege/MonoDebugTemp/'.
---> Renci.SshNet.Common.ScpException: scp: error: unexpected filename:
bei Renci.SshNet.ScpClient.CheckReturnCode(Stream input)
bei Renci.SshNet.ScpClient.UploadFileModeAndName(IChannelSession channel, Stream input, Int64 fileSize, String serverFileName)
bei Renci.SshNet.ScpClient.Upload(Stream source, String path)
bei SshFileSync.SshDeltaCopy.UploadFile(Stream input, String path) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 408.
bei SshFileSync.SshDeltaCopy.CreateAndUploadFileDiff(ConcurrentDictionary`2 localFileCache, ConcurrentDictionary`2 filesNoUpdateNeeded, String fileListToDelete) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 558.
bei SshFileSync.SshDeltaCopy.DeployDirectory(String sourceDirectory, String destinationDirectory) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 296.
bei VSMonoDebugger.SSH.SSHDebugger.<>c__DisplayClass3_0.<<StartDebuggerAsync>b__0>d.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SSHDebugger.cs:Zeile 55.
--- Ende der internen Ausnahmestapelüberwachung ---
bei VSMonoDebugger.SSH.SSHDebugger.<>c__DisplayClass3_0.<<StartDebuggerAsync>b__0>d.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SSHDebugger.cs:Zeile 111.
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
bei VSMonoDebugger.VSMonoDebuggerCommands.<DeployAndRunCommandOverSSH>d__25.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\VSMonoDebuggerCommands.Implementation.cs:Zeile 146.
2019-05-15 09:10:17.0371|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
I couldn't reproduce the error. Does the error always occur? What if the Project is opened from another folder? Is there write permission to the folder for the SSH user?
I found the problem and a workaround.
It seems the the SSH(SCP?) Server in my linux has fixed a security related bug. This leads to a problem with the SSH.NET library related issue
I compiled and included the 2016.0.0 version of SSH.NET into VSMonoDebugger and now I can debug on my embedded linux.
Thanks for troubleshooting. Unfortunately I had to upgrade to SSH.NET 2016.1.0.0, to avoid crashes with compressed content > 100 MB.
So I can't just downgrade. I must hope that the bug will be fixed in SSH.NET. Otherwise I would have to try to solve the error in a fork myself. But I just don't have the time.
Try to use the new extension VSMonoDebugger2022 with Visual Studio 2022. There I'm using the nuget SSH.NET.Fork.