无法将 Visual studio 连接到 MAC Mini - Xamarin

Unable to connect Visual studio to MAC Mini - Xamarin

我正在尝试将 MAC Mini 连接到 Windows PC 运行 visual studio 但无法连接。

我已经尝试了 Xamarin 文档中提到的所有内容 HERE
我们已成功将同一个 MAC Mini 连接到网络上的另一台 PC,但似乎无法将其与另一台 PC 连接 (Note: We are not connecting both at the same time)

我们检查了 SSH,它似乎没问题 - 我们可以使用 PUTTY 和 GIT Bash。

连接

我们还使用了 MAC 的正确用户名 - 我们使用 whoami 命令检索。

以下是日志文件内容。

Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-10-28 15:58:04.7169] MacServer State transition from DisconnectedState to SshConnectingState on XT-14.local (192.168.0.214)
Xamarin.Messaging.Client.Ssh.SshMessagingConnection Error: 0 : [2016-10-28 15:58:15.0329] An unexpected error occurred on with the current SSH Session
Renci.SshNet.Common.SshException: Message type 80 is not valid.
   at Renci.SshNet.Session.LoadMessage(Byte[] data)
   at Renci.SshNet.Session.ReceiveMessage()
   at Renci.SshNet.Session.MessageListener()
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-10-28 15:58:18.9447] Starting Broker 4.1.1.3 in port 50843...
System.Net.Mqtt.TcpChannel Warning: 0 : [2016-10-28 15:58:26.0069] The TCP Network Stream has completed sending bytes. The observable sequence will be completed and the channel will be disposed
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-10-28 15:58:26.2103] MacServer State transition from SshConnectingState to DisconnectedState on XT-14.local (192.168.0.214)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Error: 0 : [2016-10-28 15:58:26.3702] An error occurred on the underlying client while executing an operation. Details: The client vs4940Lenov has been disconnected while trying to perform the connection
System.Net.Mqtt.Client.ClientPacketListener Warning: 0 : [2016-10-28 15:58:26.5290] Client vs4940Lenov - Packet Channel observable sequence has been completed
Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Information: 0 : [2016-10-28 15:58:26.6871] Disconnected from Mac XT-14.local (192.168.0.214)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Error: 0 : [2016-10-28 15:58:26.8482] Couldn't connect to XT-14.local. Please try again.
System.Net.Mqtt.Client.Client Error: 0 : [2016-10-28 15:58:27.0164] System.Net.Mqtt.Client.ClientException: The client vs4940Lenov has been disconnected while trying to perform the connection
   at System.Net.Mqtt.Client.Client.<ConnectAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingConnection.<ConnectAsync>d__18.MoveNext()
Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Error: 0 : [2016-10-28 15:58:27.2886] There was an error while trying to connect the client vs4940Lenov to the server.
Xamarin.Messaging.Exceptions.MessagingException: There was an error while trying to connect the client vs4940Lenov to the server. ---> System.Net.Mqtt.Client.ClientException: The client vs4940Lenov has been disconnected while trying to perform the connection
   at System.Net.Mqtt.Client.Client.<ConnectAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingConnection.<ConnectAsync>d__18.MoveNext()
   --- End of inner exception stack trace ---
   at Xamarin.Messaging.Client.MessagingConnection.<ConnectAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.Ssh.SshMessagingConnection.<ConnectAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.Messaging.VisualStudio.MessagingService.<ConnectAsync>d__73.MoveNext()
System.Net.Mqtt.TcpChannel Error: 0 : [2016-10-28 15:58:27.7771] An error occurred while closing underlying channel. Error code: 10054
System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
   at System.Net.Mqtt.TcpChannel.Dispose(Boolean disposing)

更新 1

这是一张图片

将 Visual Studio 连接到 Mac 主机时,务必确保 Xamarin 工具在两个系统上同步并且版本号匹配。

在这种情况下,其中一台计算机似乎是 运行 Xamarin 工具的过时版本。将此更新到最新的稳定版本解决了这个问题。

更多信息可以在 Xamarin 的 Connecting to the Mac guide, and if problems persist I'd recommend checking out the Troubleshooting 指南中找到,因为它概述了常见问题/已知问题/解决方法。