Deploy requires reboot of Netduino each time

It has been a while since I have been fiddling with a Netduino (Netduino Plus days). I just got a Netduino 3 WiFi and building/deploying has been a little rough. Each time I make a change and want to deply, I have to reconnect my Netduino or hit the onboard reset just before deploying. Otherwise I get “An error has occurred: please check your hardware.” Occasionally I even have to go into MFDeply and erase the device before I can get it to deploy. I don’t remember having to do this dance before, is this to be expected? Do I need a different driver? Is there something I need to change in config somewhere?

It seems like if I deploy by debugging (F5) I have a lot more success than if I just try deploying to the device directly.

You can experience this sort of problem if you have a very tight loop somewhere in your code. Something like the following can cause issues:

while (true)
{
    if (input == true)
    {
        DoStuff();
    }
}

usually causes issues. If possible it is a good idea to convert code to use interrupts and use an infinite timeout at the end of the main loop or have a small sleep somewhere in the while loop.

Regards,
Mark