Featured post
backgroundworker - C#: Why is my background worker thread signaling done when it isn't? -
c#, using vs2010 , i've got makes no sense.
at startup program needs load several hundred k text files. after ensuring loading code working fine threw in background thread. long run within ide everything's fine when it's run standalone thread says it's done when isn't. of course goes boom.
the trigger code:
backgroundworker background = new backgroundworker(); background.runworkercompleted += new runworkercompletedeventhandler(databaseloaded); background.dowork += new doworkeventhandler(delegate { database.load(); }); background.runworkerasync();
and stuff that's going boom in databaseloaded()
.
i put messageboxes trace what's going on: first , last lines of load()
method , first line of databaseloaded()
.
in ide triggers expect: load()
beginning, load()
done, databaseloaded()
. however, when run standalone load()
beginning, databaseloaded()
, unhandled exception box (the loader hasn't gotten build empty tables, let alone fill them.)
am nuts or microsoft?
runworkercompleted
invoked in case of error (such unhandled exception in database.load()
). check error
property of runworkercompletedeventargs
.
- Get link
- X
- Other Apps
Comments
Post a Comment