Reputation: 131
I have been working on Windows IOT and Raspberry PI 2 for a bit now, but all my work was through Visual Studio 2015. Things were going fine until I wanted to run the app without Visual Studio (standalone mode), thats when things started to make me go crazy.
The app runs fine in debug, but the moment I go to the IOT web interface to run it standalone, I always get "Failed to start package BlinkyHeadlessVB...". Im running the exact copy of the samples from Microsoft for the BlinkyHeadless.
I have tried building in release mode and deploy, same result (fine through VS but failed to start by itself). Raspberry PI is running in headless mode. I even tried checking the box "Do not launch, but debug my code when it starts", same thing, cannot run it from the web interface. I also tried building the appx file and install it through the web interface, same thing.
Im going crazy, especially that the error says it failed without any explanations anywhere (at least none i could find).
I feel im missing something simple (and probably stupid).
Anybody have any ideas? I googled for hours and couldn't find a working solution.
Your help is greatly appreciated..
Environment Details:
Host Machine: Windows 10
IDE: Visual Studio 2015 Community Edition with Update 1
Device: Raspberry PI 2 Model B
Device OS: Windows IOT v10.0.10586
Project trying to run: BlinkyHeadlessVB
Upvotes: 3
Views: 646
Reputation: 131
I solved the issue. I'm going to post the solution in case someone else encountered this issue and, hopefully, it may help them.
First mistake, i was using a ManualResetEvent to block the BackgroundTask from exiting. I should have used a BackgroundTaskDeferral. Ex:
Private deferral As BackgroundTaskDeferral
Public Sub Run(taskInstance As IBackgroundTaskInstance) Implements IBackgroundTask.Run
deferral = taskInstance.GetDeferral
'Your startup code
End Sub
Then, even after add the deferral, it wasn't starting from the web interface, i had connected to the PI through PowerShell (using enter-pssession) and set my application to be the startup app.
Removed the default startup app:
iotStartup remove headless zwave
set my app to the default startup:
iotStartup startup headless myApp
restart and it will list as the running app in the Apps page in the web interface..
Hope that helps someone out there..
Firas
Upvotes: 4