xunit / devices.xunit

xUnit.net Runners for Devices
Other
73 stars 36 forks source link

Breakpoints have stopped working in visual studio since last xamarin update. #29

Closed kensykora closed 8 years ago

kensykora commented 8 years ago

I'm using xunit pretty extensively, this project is particularly great for running tests on the devices. However, after yesterday's major update, my breakpoints within unit tests are no longer causing the debugger to stop in visual studio. However, breakpoints do hit, but application execution is suspended -- it's just visual studio doesn't pick up on the breakpoint and I can't resume or step over, or anything like that.

Looking for ideas on how to troubleshoot this. Let me know if this belongs more in the xamarin territory. I figured I'd try here, because breakpoints still work within my application -- just not the test runner.

Visual Studio 2013

kensykora commented 8 years ago

Attached is a link with a minimum set of reproducible code and Xamarin version numbers of the platform I'm currently running on.

https://www.dropbox.com/sh/au84myj9dgmj8hw/AAC5Sd31ruAHtnbYyoSdE9yua?dl=0#

clairernovotny commented 8 years ago

I'm pretty sure this is a Xamarin issue/bug. I'd suggest opening up an issue there; feel free to cc me there.

kensykora commented 8 years ago

Agreed -- I sent an email to their support. If you want to shoot me an email with your email address, I'll copy you on the support chain.

AArnott commented 8 years ago

+1 andrewarnott@gmail.com I've subscribed to this thread, but please CC me as well.

clairernovotny commented 8 years ago

The Xamarin Bugzilla for this is here: https://bugzilla.xamarin.com/show_bug.cgi?id=36087

jamesmontemagno commented 8 years ago

Have you attempted to uninstall all of the Mono/Xamarin.Android runtimes from your device/emulator? sometimes that stuff can muck it up. Usually going through you installed apps on your android device and uninstalling them all then letting the latest can fix it up.

kensykora commented 8 years ago

It is an issue both in iOS and Android, so it's not just limited to Android.

kentcb commented 8 years ago

I reported this to Xamarin directly and they confirmed it was a bug. However, I only observed it in Android, not iOS. Ticket: https://bugzilla.xamarin.com/show_bug.cgi?id=36078

@jamesmontemagno: didn't try that - will try first thing Monday

kentcb commented 8 years ago

@jamesmontemagno also, not really convinced this will help for two reasons:

  1. Breakpoints work outside of tests (even in the startup activity for the test harness, just not the tests themselves)
  2. Xam support were able to repro the issue

That said, I'll try your suggestion and report back here.

digital-synapse commented 8 years ago

Does anyone have any updates on this? Having the same problem. This makes TDD for xamarin/android next to impossible.

bradwilson commented 8 years ago

Shouldn't this bug be opened with Xamarin?

clairernovotny commented 8 years ago

There is an open bug, linked above. No progress on it so far other then their confirmation of a repro.

kensykora commented 8 years ago

For those here, I've been able to sometimes work around this issue if I put a breakpoint in the main thread that gets hit before breakpoints that happen within async/await code. If a breakpoint in the main thread hits, it seems to allow breakpoints in async code to hit also.

AArnott commented 8 years ago

For me, the app just hangs whenever it encounters a method with a breakpoint in it, including AppDelegate itself.

clairernovotny commented 8 years ago

I just sent them a support email via the priority queue....lets see what happens.

kentcb commented 8 years ago

@onovotny been there, done that. But please don't let that stop you. The more people shouting, the more likely this will be fixed.

I have found the most effective way of testing Xamarin applications is to.....not use Xamarin. I unload all Xamarin projects, put my tests in a PCL that I run via NCrunch or VS Test Runner, and do as much work as I can (services, view models) without loading the Xamarin tool chain. Only once I'm done there do I reload the Xamarin projects, double-check tests pass in the devices, and wire up the views.

It's sad, but that's the sorry state of Xamarin's tool chain at the moment.

digital-synapse commented 8 years ago

@onovotny I hope they can get this patched for you before Xamarin Evolve 16 or its going to be pretty hard to do any kind of walkthough...

clairernovotny commented 8 years ago

Anyone want to give this a shot to confirm? https://bugzilla.xamarin.com/show_bug.cgi?id=36078

https://www.dropbox.com/s/ugaodugklwkjboo/Xamarin.VisualStudio_4.0.1.102.msi?dl=0

There appears to be a fix.

digital-synapse commented 8 years ago

Sweet! I did some preliminary tests. This does appear to fix the async code breakpoints! Thank you this is very helpful!

FrancoisM commented 8 years ago

Same issue, fixed with the patch :+1:

clairernovotny commented 8 years ago

Closing as this should be fixed in the stable channel.