UWP - create_task crashed when running under Debug x64 instead of x86


I have the following asynchronous programming codes that are retrieving a file in a UWP app bundle:

Uri ^source = ref new Uri("ms-appx:///head.html");
auto getFileTask = create_task(StorageFile::GetFileFromApplicationUriAsync(source));

When I run the code in Visual Studio 2017 in Debug x86 mode, it works fine. However, running it in Debug x64 causes the app to crash with the following error:

HRESULT:0x80070002 The system cannot find the file specified.
WinRT information: The system cannot find the file specified.

and Visual Studio breaks in the file ppltasks.h at this code:

    if (_M_exceptionObserved == 0)
        // If you are trapped here, it means an exception thrown in task chain didn't get handled.
        // Please add task-based continuation to handle all exceptions coming from tasks.
        // this->_M_stackTrace keeps the creation callstack of the task generates this exception.

Any help?

asked on Stack Overflow Apr 24, 2019 by Kevin

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0