Problems with Breakpoints

Hello!

I’ve been struggling with a few issues regarding breakpoints not being hit. Working on Windows seems to be more reliable than working on Mac. I’ve tried a few obvious things (deleting bin/obj/userprefs) and it does not seem to help. I’ve also noticed that I commented out code and it’s still running on the device (I can see logs that I shouldnt).

Are there any tips for troubleshooting this?

Thanks!

Not familiar with working on a Mac … but Windows/Visual Studio 2015 … you are compiling for the Debug Solution Configuration and not the Release Solution Configuration, right? I’m not saying you can’t use breakpoints with the Release Solution Configuration, but using Debug Solution Configuration may be more reliable. Never had any issues with hitting breakpoints … could also be the code never gets executed that you are setting the breakpoints for. Only things I can think of at this point.

@John it’s a known issue on mac :frowning:

exceptions are also broken

if you’re up for it, you can run the add in from source, set the breakpoints in the add in and see what’s happening.

basically, they used to work, then roslyn happened, which changed everything, and we haven’t been able to catch up. that exception issue has some more details on where to set the breakpoints to see how it’s failing. It may be an easy fix, but i have no idea how that code works.

@bryancostanich

Thanks for the reply. Thanks for the links! The breakpoints issue happens on Windows too. Not every time, but sometimes. It’s deff worse on the Mac as you confirmed. Thanks for the link to the exception issue. That drove me nuts for about an hour. I had an exception happening and I had no idea because my try/catch wasn’t printing anything on Mac! On Windows, I see the print so I was able to debug a little further. I’ll see if running the addin from source helps me learn anything.

I can survive on debugging with print statements for now. However, the main issue is that it seems when I deploy it’s not running the latest code. I can see print statements in the Output the I 100% know I should not see. What can I do to nuke the app on the device? I’ve tried simple stuff like deleting bin/obj and Rebuilding. (This is on Windows)

Thanks!

There are a couple of ways to nuke the application on the device:

  • Use MFDeploy to erase the application
  • Deploy a new copy of the firmware

MFDeploy should leave network settings in place but will delete the application. So fire up MFDeploy and connect to the device (see the File menu). The click on the Erase button. Should Disconnect from the device before trying to redeploying the application.

If that does not work then you can deploy a new copy of the firmware using the Firmware updater.

I must admit to being intrigued by the fact you do not seem to be able to deploy from Windows. I had seen cases where the debugger cannot deploy or attach to an application. This normally fails to deploy and start the debugger. I have never seen Windows fail to deploy and then allow the debugger to attach to the application.

For reference, the times I have seen deployment failures are usually related to tight loops or exceptions being thrown early in the life of an application.

Regards,
Mark

@John, i think you’re running into the flakiness of the MicroFramework deployment toolchain. I’ve seen the deploying of stale code quite a bit. However, I changed my workflow slightly and that fixed it for me. I usually right click on my project and rebuild before I deploy. For some reason, it doesn’t always pick up code changes if I don’t do that. I suspect that’s why your breakpoints are being hit intermittently.

Two bits of good news here. 1) We’re making progress on upgrading to .NETMF 4.4, which helps this a little bit. @Justin_Wilson has the basic port done, and now in queue is shimming the Netduino Network stuff into that port (we’re also stabilizing the network stack). And 2) for the vNext, we’re not using any of the NETMF toolchain. So these issues will go away completely; to be replaced by a whole new set of issues, i’m sure. :wink:

@bryancostanich

Thanks for the insight! I am patiently waiting for the 4.4 update as that should resolve my issue with WebRequest and using Maple.

Edit: I found the issue. The configuration did not have the “Deploy” checkbox enabled… I don’t know how I disabled that but I must have. Thanks for the help and apologies for the confusion.

I don’t think you did disable it. That seems to be a Visual Studio bug. I doc’d it here. :expressionless: