Xamarin Android(Visual Studio 2015)无法连接到调试器

Kha*_*ran 33 debugging android android-emulator xamarin visual-studio-2015

我有一个android调试器(Visual Studio 2015)的问题,因为它始终在启动调试后立即停止(它没有调试就可以正常工作),我的机器重置并重新安装Visual Studio 2015但它没有帮助.

这是来自logcat的日志:monodroid-debug错误接受stdout和stderr(127.0.0.1:8896)地址已在使用中

这是Xamarin日志的日志:

Mono.Debugging.Soft.ConnectionException: Could not connect to the debugger. ---> Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.

Server stack trace: 
at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
at Mono.Debugger.Soft.Connection.VM_GetVersion()
at Mono.Debugger.Soft.Connection.Connect()
at Mono.Debugger.Soft.VirtualMachine.connect()
at Mono.Debugger.Soft.VirtualMachineManager.Connect(Connection transport, StreamReader standardOutput, StreamReader standardError)
at Mono.Debugger.Soft.VirtualMachineManager.ConnectInternal(Socket dbg_sock, Socket con_sock, IPEndPoint dbg_ep, IPEndPoint con_ep)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at Mono.Debugger.Soft.VirtualMachineManager.ConnectCallback.EndInvoke(IAsyncResult result)
at Mono.Debugger.Soft.VirtualMachineManager.EndConnect(IAsyncResult asyncResult)
at Mono.Debugging.Soft.SoftDebuggerSession.<>c__DisplayClass9.b__8(IAsyncResult ar)
--- End of inner exception stack trace ---
Run Code Online (Sandbox Code Playgroud)

任何帮助深表感谢!

akl*_*l22 58

我有同样的问题,我可以通过以下方式连接调试器:

http://dotnetbyexample.blogspot.cz/2016/02/fix-for-could-not-connect-to-debugger.html

简而言之:

  • 在Android项目中禁用"使用快速部署(仅限调试模式)" - >属性 - > Android选项 - >打包

  • 在Hyper-V管理器中启用"迁移到具有不同处理器版本的物理计算机",转到VM - >设置 - >处理器 - >兼容性

  • 在Mac上使用Visual Studio for Mac我只需取消选中/禁用我的Android项目的"快速装配部署"(选项 - > Android构建 - >常规 - >打包和部署).谢谢! (3认同)