cannot get visual studio connected to mac

I was able to get this working. It seems that running chmod og-w "$HOME" on the MacOS device fixed it for me.

However, I'm not 100% sure that was the only step because I've been debugging this for hours, so everything I did might be unnecessary, but if the above doesn't work alone, here is everything I did:

  1. Followed steps from https://github.com/xamarin/xamarin-macios/issues/7882#issuecomment-604330852 to copy old scp (again, don't know if this was necessary)
  2. Restart both machines just so you're sure you have a clean slate.
  3. On the PC, delete contents of %LOCALAPPDATA%\Xamarin\MonoTouch directory (leave the directory itself)
  4. On the Mac, clear contents of ~/.ssh/authorized_keys file
  5. On the Mac, delete ~/Library/Caches/Xamarin/XMA directory
  6. On the Mac, run chmod og-w "$HOME"
  7. On the PC, start Visual Studio and try to connect

I had not Monotouch folder, so I created it manually and run VS using Administrator privileges. This solved my problem.


My fix to this issue was to delete the hosts.key file in this directory

%LOCALAPPDATA%\Xamarin\MonoTouch


It looks like this is an issue with Visual Studio on Windows. Microsoft seems to be aware of this and working on a solution.

Details: https://developercommunity.visualstudio.com/content/problem/928605/an-error-occurred-while-generating-the-ssh-keys-pl.html

Update: Microsoft just recently released version 16.5.2 of Visual Studio. That released (non-preview) version fixed the issue for me ;-)