Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

backgroundTaskHost.exe exits with code 1 (0x1)

I have a Windows Store application that I am creating that has a Windows Runtime Component for a background task.

The solution builds with no problems in Visual Studio but when the background task is triggered, it always fails with the message "The program '[4204] backgroundTaskHost.exe' has exited with code 1 (0x1)."

The reference to the project containing the background task is in the main project and I am setting the entry point, so I don't know what the problem is. How do I get more information as to why the program is exiting?

like image 593
Dan14021 Avatar asked Jul 28 '14 03:07

Dan14021


1 Answers

I was calling an an asynchronous method that returned void. I changed that method to return a Task and used await when I called it. The task runs correctly now.

like image 146
Dan14021 Avatar answered Sep 28 '22 08:09

Dan14021