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

oknwwptz  于 2022-11-24  发布在  Android
关注(0)|答案(6)|浏览(231)

我有一个问题与Android调试器(Visual Studio 2015),因为它总是停止后立即启动调试(它的工作就好,没有调试),我有我的机器重置和重新安装Visual Studio 2015,但它没有帮助。

以下是logcat中的日志:monodroid-debug接受标准输出和标准错误时出错(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 ---

任何帮助都是非常感谢的!

t2a7ltrp

t2a7ltrp1#

我遇到了同样的问题,我能够通过以下方式连接调试器:
http://dotnetbyexample.blogspot.cz/2016/02/fix-for-could-not-connect-to-debugger.html
简而言之:

  • 在Android项目-〉属性-〉Android选项-〉打包中禁用“使用快速部署(仅限调试模式)”
  • 在Hyper-V管理器中启用“迁移到具有不同处理器版本的物理计算机”,转到“虚拟机”-〉“设置”-〉“处理器”-〉“兼容性”
m4pnthwp

m4pnthwp2#

对我来说,这原来是戴尔笔记本电脑在Windows 10上运行的问题,在我回滚到Windows 8. 1后,它现在工作正常

gab6jxml

gab6jxml3#

接受标准输出和标准错误时出错(127.0.0.1:8896)地址已在使用中
已将其报告给Xamarin,编号为Bug 34476

jucafojl

jucafojl4#

虽然这个问题是针对VS 2015的。最近Visual Studio 2017版本15.2有这个问题。卸载Visual Studio并降级到以前的工作VS对我的情况有所帮助。希望他们很快就能修复这个错误。https://forums.xamarin.com/discussion/95555/how-to-downgrade-visual-studio-2017-version-15-2-to-15-0

unguejic

unguejic5#

我在VS 2019上也遇到了同样的问题。
什么修复了我是删除我的仿真器,并重新添加它了。

bhmjp9jg

bhmjp9jg6#

我在VS 2022中遇到了几乎相同的问题,当我试图运行xamarin-android解决方案时,突然它说“无法连接到调试器”。
我检查了@akl22的答案,也检查了这篇文章https://localjoost.github.io/fix-for-could-not-connect-to-debugger/。因此,在执行@akl22在上面的答案中提到的步骤之前,我做了以下操作

I restarted the visual studio, 2022
Cleaned the solution
Rebuilt the solution
Ran the solution again.

最后它对我起作用了。

相关问题