我正在尝试将MAC Mini连接到运行visual studio的Windows PC,但无法连接。
我已尝试过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
这是一张图片
答案 0 :(得分:1)
将Visual Studio连接到Mac主机时,务必确保Xamarin工具在两个系统上同步并且版本号匹配。
在这种情况下,看起来其中一台计算机正在运行Xamarin工具的过时版本。将此更新为最新的稳定版本可解决问题。
可以在Xamarin的Connecting to the Mac指南中找到更多信息,如果问题仍然存在,我建议您查看Troubleshooting指南,因为这会概述常见问题/已知问题/解决方法。