System.Diagnostics.Debugger.Break is obnoxious

May 15, 2015 at 9:03 AM
First let me say that after a couple of weeks working with Vita, I am very impressed and overall I think you have done a fine job.

However... System.Diagnostics.Debugger.Break is called in DbModelLoader, DbModelBuilder, and WebCallContextHandler. This behaviour is obnoxious, as it causes the NUnit Task Runner to put up a window saying it has stopped working, although it is really just waiting. This means that if the unit test code for my application causes execution of one of the methods that calls Debugger.Break() in such a way that it fails (precisely the point of the test), it is impossible to run as an automated test. I don't want to run a custom Vita build, so I would be very grateful if you would remove those in the next release.

Quite apart from my issue, I would not think that calling Debugger.Break() is an appropriate error handling method for any production software.
May 15, 2015 at 9:13 AM
haha, don't be mad, just a slip thru my code cleaning efforts. Of course it's not appropriate in production... although I thought I publish release builds (are you taking it from Nuget?), and in release build all this debugger crap goes away. Another thing, it is supposed to Break ONLY when there's debugger attached (in VS). You're saying it breaks when run in nUnit UI app? possibly you launch it from VS, I guess.
Whatever, will definitely remove this in next push. At the time when code was crushing quite frequently, I put these breaks here and there in places/handlers which catch
catastrophic events, when something is clearly broken in VITA, not in client code, just to save time in debugging.
Sorry for your troubles and thank you for your kind words.
Expect new version in a few days, hopefully by sunday night
Roman