0

Problem: ContinueFileOpenPicker, the file reading action is success in debugging mode (even in release build), but not success when the release APP running independently.

I read a text file in my window 8.1 phone by using a file picker,

in debug mode, the file picker return the file and showing waiting to restore to my APP, and the reading is SUCCESS.

but when I run the APP directly, the file picker return to my APP straight away without waiting, then within seconds later my app crashed, perhaps read some lines but not all.

the code for reading are as following.

public async void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
{
    try
    {
        int nRecords = await ImportACUFile(files[0]);
    }
    catch (Exception ex)
    {
    }
}

public async Task<int> ImportACUFile(StorageFile acufile)
{
    using (var db = new SQLite.SQLiteConnection(DBPath))
    {
        var lines = await Windows.Storage.FileIO.ReadLinesAsync(acufile);
        foreach (var line in lines)
        {.....}
        .....
    }
}

Can anyone help me to identify the problem is?

THANKS A LOT AHEAD!!!

LONG

John Warlow
  • 2,922
  • 1
  • 34
  • 49
long.h
  • 31
  • 1
  • Where do you get the error? And more important: What kind of Exception do you get? – Wosi Aug 14 '15 at 12:09
  • I suspect that problem may be connected with suspending, which is not performed while you are debugging the app. Debug the whole procedure once more and suspend the app, check what happens. To debug those events [use lifecycle events tab](http://stackoverflow.com/a/24103734/2681948). – Romasz Aug 14 '15 at 12:18
  • Thank you Romasz, Your suggestion is helpful, however, I am new to developing the APP, I don't know how to get the exception code while I run the release build APP in my mobile alone. I only debug on my mobile because my laptop OS is home ver. Now I have solved the problem by another way, the conclusion is: I suspect that i do too much work in the "ContinueFileOpenPicker" function. Now I just keep the storagefile, and load the file later. and all problems solved. I still hope that anyone can give me a link to show me how to get the exception code in release build. I am using C# in VS2015. – long.h Aug 15 '15 at 01:29

0 Answers0