Tuesday, 15 May 2012

c# - Why am I getting so many non-crashing "A method was called at an unexpected time" exceptions? -



c# - Why am I getting so many non-crashing "A method was called at an unexpected time" exceptions? -

it scarcely exaggerating see more of these when app runs:

exception:thrown: "a method called @ unexpected time. (exception hresult: 0x8000000e)" (system.invalidoperationexception) system.invalidoperationexception thrown: "a method called @ unexpected time. (exception hresult: 0x8000000e)" time: 10/17/2014 9:18:21 pm thread:worker thread[7528]

...than can stir stone at.

after doing research, came conclusion, "i must have async code isn't using await"

but async code far is:

private async void convertuserselectionstomapmarkers() { fileopenpicker openpicker = new fileopenpicker(); openpicker.viewmode = pickerviewmode.thumbnail; openpicker.suggestedstartlocation = pickerlocationid.pictureslibrary; openpicker.filetypefilter.add(".jpg"); openpicker.filetypefilter.add(".jpeg"); openpicker.filetypefilter.add(".png"); list<photraxexifdata> exifdatalist = new list<photraxexifdata>(); ireadonlylist<storagefile> files = await openpicker.pickmultiplefilesasync(); (int = 0; < files.count; i++) { using (var randomaccessstream = await files[i].openasync(fileaccessmode.read)) { using (var stream = randomaccessstream.asstream()) { using (var exfrdr = new exifreader(stream)) . . .

i tried adding awaits lastly 2 usings, not alowed in instances.

could sqlite-net code? part of project has asyncs besides code above.

should worry it, since it's not seemingly causing problem? or accident waiting happen?

how 1 know should set "awaits"?

c# windows-store-apps async-await

No comments:

Post a Comment