This stupid error plagued me for almost a year before a colleague of mine found a fix. If you see this:
You can make the following registry change to avoid this. This was happening on machines that were running UI tests, so this top-most dialog was causing tests to fail, pretty horrible considering there is no explanation as to the cause. Apply this reg change and move on:
HKLM/SYSTEM/CurrentControlSet/Control/Windows/ErrorMode=2
For reference see: